[Haskell-cafe] Subsets and supersets
brandon_m_moore at yahoo.com
Wed Mar 16 14:38:02 CET 2011
You want polymorphic variants. Check out O'Caml, or MLPolyR.
Subtyping is not very compatible with first-class functions. If you have
("forall A a subtype of T, ..."), and your subtype relation says A -> B is a
subtype of C ->D whenever
A is a supertype of C and B is a subtype of D, then checking subtyping is
I might as well mention here that in any OO language with protected methods or
subclass is not a subtype in any behavioral sense - and terminal coalgebras have
so little structure
that just working in terms of the interface doesn't seem too useful.
More information about the Haskell-Cafe