Re: LSP
Bardur Arantsson <[email protected]>
| Newsgroups | gmane.comp.lang.scala |
|---|---|
| Message-ID | <[email protected]> |
On 06/18/2015 11:48 PM, Shelby wrote: > On Friday, June 19, 2015 at 2:37:49 AM UTC+8, Bardur Arantsson wrote: > >> Uh, see the formal definition with is slightly below on the same >> Wikipedia page. >> >> And yes, it's very hard to *not* violate that rule. Hence "prefer >> composition over inheritance" and such guidelines. >> > > Seems it is easy to not violate is for covariant List[T] for as long as the > types in T don't use inheritance. Well I am not really making a point am I. > Because being covariant on its type parameter is not inheritance. > Subtyping isn't really needed much in practice[1] if you have existential types. (See e.g. Haskell.) (Of course you could argue that existential types are a limited form of subtyping, I guess.) [1] AFAICT from my own experience. YMMV, of course. Regards, -- 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.