[Haskell-cafe] Question about Haskell types

Brian Hulley brianh at metamilk.com
Sun Feb 26 11:40:29 EST 2006


Neil Mitchell wrote:
> Hi Pete,
>
>> a = (<)
>> b x = (x <)
>> c x y = (x < y)
>
> I'm pretty sure this is the Monomorphism Restriction, its on the wiki
> at: http://www.haskell.org/hawiki/MonomorphismRestriction

You can use ghc -fno-monomorphism-restriction to compile the above or 
alternatively give a type signature for a ie

a :: Ord p => p->p->Bool
a = (<)

Perhaps some later version of Haskell might get rid of this restriction by 
default (here's hoping! :-) )

Regards, Brian. 



More information about the Haskell-Cafe mailing list