[Haskell-cafe] Trouble with types
v.reshetnikov at gmail.com
Tue Jun 2 01:30:59 EDT 2009
Could you please explain what does mean 'monomorphic' in this context?
I thought that all type variables in Haskell are implicitly
universally quantified, so (a -> a) is the same type as (forall a. a
On 6/1/09, Daniel Fischer <daniel.is.fischer at web.de> wrote:
> Am Montag 01 Juni 2009 14:44:37 schrieb Vladimir Reshetnikov:
>> I tried this code:
>> f, g :: a -> a
>> (f, g) = (id, id)
>> Hugs: OK
>> Couldn't match expected type `forall a. a -> a'
>> against inferred type `a -> a'
>> In the expression: id
>> In the expression: (id, id)
>> In a pattern binding: (f, g) = (id, id)
>> What does mean this error message?
>> And what of them (Hugs, GHC) is correct?
> Section 220.127.116.11, Declarations and bindings
> GHC's typechecker makes all pattern bindings monomorphic by default; this
> behaviour can be
> disabled with -XNoMonoPatBinds. See Section 7.1, “Language options”.
> Hugs is correct, it's a known infelicity in GHC which can be disabled.
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe