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

Al Falloon afalloon at synopsys.com
Thu May 31 10:36:13 EDT 2007


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?

What is the canonical solution to the expression problem in Haskell?

What techniques do Haskellers use to simulate subtyping where it is 
appropriate?

I bring this up because I have been working on a Scheme compiler in 
Haskell for fun, and something like polymorphic variants would be quite 
convinent to allow you to specify versions of the AST (input ast, after 
closure conversion, after CPS transform, etc.), but allow you to write 
functions that work generically over all the ASTs (getting the free 
vars, pretty printing, etc.).

--
Alan Falloon



More information about the Haskell-Cafe mailing list