
31 May
2007
31 May
'07
4:25 p.m.
apfelmus wrote:
Al Falloon wrote:
OCaml has been getting a lot of mileage from its polymorphic variants (which allow structural subtyping on sum types) especially on problems relating to AST transformations and the infamous "expression problem".
Has there been any work on extending Haskell's type system with structural subtyping?
There's OO'Haskell but I don't know much about it. The problem with subtyping is that it renders type inference undecidable and is more limited than parametric polymorphism. It's more like a "syntactic sugar", you can always explicitly pass around embeddings (a' -> a) and projections (a -> Maybe a').
Quite. So another interesting question to ask is 'has anyone proposed any good syntactic sugar?' Jules