
29 Jun
2001
29 Jun
'01
3:42 a.m.
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
8726
Age (days ago)
8726
Last active (days ago)
0 comments
1 participants
participants (1)
-
Michael Ackerman