Re: [Haskell-cafe] Subsets and supersets

2011-03-21 Thread Henning Thielemann
Andrew Coppin schrieb: Haskell has ADTs. Most of the time, these work great. As I've written in several other places (but possibly not here), OO languages tend to factor the problem the other way. That is, if I want a binary tree, an OO language makes me split the type and all of its

[Haskell-cafe] Subsets and supersets

2011-03-16 Thread Andrew Coppin
The other day I saw the green field Haskell discussion on Reddit. Of course, I could give you a very long list (ha!) of things that I would change about Haskell. (This would probably begin with expunging Monad.fail with extreme prejudice...) But there's one particular feature which is

Re: [Haskell-cafe] Subsets and supersets

2011-03-16 Thread Brandon Moore
You want polymorphic variants. Check out O'Caml, or MLPolyR. Subtyping is not very compatible with first-class functions. If you have subtype-bounded polymorphism (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

Re: [Haskell-cafe] Subsets and supersets

2011-03-16 Thread Yves Parès
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 undecidable. In fashion terms: operator (-) is contravariant in its first argument and covariant in its second. ;) 2011/3/16 Brandon Moore