The dreaded M-R

Simon Peyton-Jones simonpj at microsoft.com
Fri Jan 27 05:54:16 EST 2006


| >How about an even simpler solution:
| >
| >  *All* pattern and variable bindings are monomorphic unless a type
| >  signature is given.
| >


| Now that IS an interesting idea. The more I think about it, the more I
like it.

I like it too.  But be aware that a top-level definition 

	reverse = foldr (\x ys -> ys ++ [x]) []

would get the inferred type

	[()] -> [()]

because it'd be monomorphic, and completely un constrained type
variables are defaulted to (), in GHC at least.

Simon


More information about the Haskell-prime mailing list