[cvs-nhc98] nhc doesn't default types as aggressivley as it should?
Malcolm Wallace
Malcolm.Wallace@cs.york.ac.uk
Thu, 20 Dec 2001 10:49:19 +0000
> I think that in
>
> module Q where
> Just a = if 5 == 5 then Just 6 else Nothing
>
> (which gives me
>
> ====== Errors after type inference/checking:
> Context for Prelude.Num needed in left hand pattern at 4:3.
>
> ) nhc should default the type of a to Integer, and ghc and hugs seem to
> agree.
Yes, this should be defaulted to Integer via the monomorphism
restriction, but nhc98 does not implement the DMR. It is a documented
feature/bug.
Regards,
Malcolm