
25 Mar
2012
25 Mar
'12
11:34 a.m.
Hi guys, Give the following code: ================ module Main where class C a where bar :: C a => a -> a bar x = x foo = bar bar main = do putStrLn "hello" ================ GHC says "No instance for (C (a0 -> a0)) arising from a use of `bar'", which is what I would normally expect. But with -XNoMonomorphismRestriction, it compiles without even a warning, as long as I don't use `foo' somewhere. Could someone please explain why this is so? Thanks, Máté