[Haskell-cafe] Re: Has anyone looked into adding subtyping to Haskell?

Jules Bean jules at jellybean.co.uk
Thu May 31 12:25:42 EDT 2007


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


More information about the Haskell-Cafe mailing list