Re: Implict parameters and monomorphism
3 May
2001
3 May
'01
12:19 p.m.
Try this program: -- Try commenting out this type signature. fun:: (Num a) => a -> Int
Defaulting applies only when all classes involved are Haskell 98. hbc, nhc98 and Hugs are not conforming.
Seems you're right (all classes for the ambiguous type variable need to be from prelude or standard libraries). Okay, so let's try the good old boring show: -- ii :: Double ii = 1 main = case length (show ii) of { 1 -> putStrLn "type signature excluded" ; _ -> putStrLn "type signature included" } Still, I liked Lennart's "magic" version;-) Claus
9252
Age (days ago)
9252
Last active (days ago)
0 comments
1 participants
participants (1)
-
C.Reinke