Re: [scala-language] The cake’s problem, dotty des ign and the approach to modularity.
Shelby <[email protected]>
| Newsgroups | gmane.comp.lang.scala |
|---|---|
| Message-ID | <[email protected]> |
Are readers able to see the post I made on July 18 which starts with following? When viewing this thread in Google Groups, it appears to have inserted [scala-language]" into the subject line causing the start of a new thread (and other mangling of my post). > I believe I show herein the fundamental importance of objects (as in "OOP"), that subclassing (but not subtyping) > is fundamentally an anti-pattern, and that the new DOT calculus is essential. Hi Vlad, Covariance: a set of types (whether represented as a subsumption to a nominal supertype or the supertype which is a disjunction of the nominal types) can be operated on by a function which inputs that subsumption (or the set of the corresponding supersumption) or outputs the set of that subsumption (or the corresponding supersumption). Contravariance: a set of types (whether represented as a supersumption to a nominal subtype, e.g. _|_ aka Bottom/Nothing, or the subtype which is a conjunction of the nominal types) can be operated on by a function which inputs that supersumption (or the set of the corresponding subsumption) or outputs the set of that supersumption (or the corresponding subsumption). But how can we do any operations on a conjunction of types? I remember Adriaan Moors explanation that in the DOT calculus a disjunction of types contains the conjunction of methods of those types (and shared methods input a conjunction of the inputs of those methods) and conversely a conjunction of types contains the disjunction of methods of those types (and shared methods input a disjunction of the inputs of those methods). If a set of types share a set of methods (perhaps implemented as typeclass rather than virtual inheritance so the dictionary can be injected with an object), then the disjunction of those types is the conjunction (and the conjunction of those types is the disjunction) of the implementations of that interface. But note that A ∧ A = A ∨ A, so thus both disjunction and conjunction can be operated upon if they share an interface A. That was the point of my prior post. How does your point relate to mine? On Sunday, July 19, 2015 at 4:17:38 AM UTC+8, Vlad Patryshev wrote: > I would not seriously involve LSP into solving this kind of problems. LSP > is for explaining things to beginners, not for solving problems in "applied > category theory" (as some people call programming these days). > > One of the solutions is to think about a natural transformation from a > covariant functor to a contravariant functor (List[+T] => List[-T]). > > Thanks, > -Vlad > -- You received this message because you are subscribed to the Google Groups "scala-language" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.