Ambiguous type variable
Ketil Z. Malde
ketil@ii.uib.no
23 Jan 2003 15:05:08 +0100
"Simon Peyton-Jones" <simonpj@microsoft.com> writes:
> R.hs:1:
> Ambiguous type variable `a' in constraints
> `Random a' arising from use of `randomRs' at R.hs:4
> `Num a' arising from the literal `0' at R.hs:4
> Possible cause: the monomorphism restriction applied to the
> following:
> f :: Int -> [a] (bound at R.hs:4)
How about explicitly suggesting a type signature? Referring to
"the monomorphism restriction" will probably not be helpful to
novices, who are the ones who need clear error messages the most.
-kzm
--
If I haven't seen further, it is by standing in the footprints of giants