Hello,
I tried this:
data Nat = Zero | Succ Nat
instance Enum Nat where
fromEnum Zero = 0
fromEnum (Succ n) = 1 + fromEnum n
toEnum 0 = Zero
toEnum n = if n > 0 then 1 + toEnum n
else error "bah"
and I get, from Hugs, the error message,
Implementation of toEnum requires extra context
Expected type: Enum Nat => Int -> Nat
Missing context: (Num Nat, Num Nat)
I'm baffled (esp. by the last line). Any help will be appreciated.
Michael Ackerman
_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe