
Ok I've figured out why I can't compile it. But now I'm more confused
than ever. The problem was that I have a -XNoMonomorphismRestriction
flag on Ghci. Removing this allowed me to compile.
But why?
-deech
On Sat, Jan 22, 2011 at 2:07 AM, Magnus Therning
On 22/01/11 06:03, aditya siram wrote:
Hi all, The following function gives me an "Ambiguous type variable `a' in the constraint: `Read a' arising from a use of `res'" error: test :: Read a => String -> Maybe [(a,String)] test s = if null res then Nothing else Just $ fst $ head res where res = reads s
This code doesn't give me that error, in fact it gives me no error at all.
/M
-- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus@therning.org jabber: magnus@therning.org twitter: magthe http://therning.org/magnus
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners