[Hugs-users] natural numbers
aldirithms at gmx.net
aldirithms at gmx.net
Thu Aug 3 16:14:02 EDT 2006
Hello,
thanks a lot for the expeditious replies to my trifling question. Here is another one:
Can you tell me why the following does not function? I mean the last part for converting number into the new data type. If this is not a quick fix, please ignore it. As an utter beginner, I cannot estimate the significance of my questions.
data Nat = Zero | Succ Nat
natToInt Zero = 0
natToInt (Succ n) = (natToInt n) + 1
number n = case n of
0 -> Zero
_ -> Succ(number(n-1))
Thank you very much.
--
"Feel free" – 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail
More information about the Hugs-Users
mailing list