nhc doesn't default types as aggressivley as it should?

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. Thanks Ian

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
participants (2)
-
Ian Lynagh
-
Malcolm Wallace