help from the community?

Jacques Carette carette at mcmaster.ca
Thu Feb 1 16:31:22 EST 2007



Stephanie Weirich wrote:
> I don't think we want to allow types like:
>
>     forall . Int   or     forall a b. Int
>
> These types are mostly bugs. Furthermore, rejecting them doesn't limit 
> expressiveness: they should both be "equivalent" to Int, so user could 
> just write Int. I can't really think how allowing these types extends 
> the expressiveness of the language, nor can I imagine a situation 
> where someone would prefer seeing one of these types instead of Int. 

If you restrict yourself to programs entirely written by humans, I agree 
completely.  But if you consider programs written by programs (say 
Template Haskell to be specific, but it could be via many other means), 
such degenerate types occur rather often.  Haskell does have 'const' at 
the value-level, and it is very useful.  And so is 'const' at the 
type-level, especially for code generators.

If there were a standard library of type-simplifiers, that could 
preprocess "forall a b. Int" to "Int", I again would be fine with only 
allowing Int.

Jacques


More information about the Haskell-prime mailing list