natural numbers
[email protected] Thu, 03 Aug 2006 22:14:02 +0200
| Newsgroups | gmane.comp.lang.haskell.hugs.user |
|---|---|
| Message-ID | <[email protected]> |
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