
21 May
2010
21 May
'10
10:37 p.m.
On Fri, May 21, 2010 at 8:59 PM, R J
If I type "toEnum 5," the error I get is: <interactive>:1:0: Ambiguous type variable `a' in the constraint: `Enum a' arising from a use of `toEnum' at <interactive>:1:0-7 Probable fix: add a type signature that fixes these type variable(s) *Main>
Here the problem is not in your instance of Enum, but that GHCi doesn't know which instance of enum to use. In most code this isn't a problem, because the surrounding context often gives enough information for the type-checker to work with. But when there isn't enough context, you'll need to provide a type signature. Does "toEnum 5 :: Day" work? Antoine
5478
Age (days ago)
5478
Last active (days ago)
0 comments
1 participants
participants (1)
-
Antoine Latter