
29 Jun
2001
29 Jun
'01
4:43 a.m.
Oops. Sorry for stupid question. Michael Ackerman Levent Erkok wrote:
On Friday 29 June 2001 07:42 am, you wrote:
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"
Don't you actually mean:
if n > 0 then Succ (toEnum n) else error "bah"
in the last line?
-Levent.
8726
Age (days ago)
8726
Last active (days ago)
0 comments
1 participants
participants (1)
-
Michael Ackerman