
22 Jan
2011
22 Jan
'11
3:07 a.m.
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