On Fri, May 21, 2010 at 8:59 PM, R J <[email protected]> wrote: > 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 _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
