Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. accumenlator problem (Roelof Wobben)
----------------------------------------------------------------------
Message: 1
Date: Wed, 13 May 2015 13:43:20 +0200
From: Roelof Wobben <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: [Haskell-beginners] accumenlator problem
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252; format=flowed
Hello,
I have this :
-- | Convert a digit to a list for example 123 becomes [1,2,3]
toDigits :: Integer -> [Integer]
toDigits number
| number <= 0 = []
| number > 0 = toDigitsAcc [] number
toDigitsAcc:: [Integer] -> [Integer] -> [Integer]
toDigitsAcc acc number
| number <= 0 = acc
| number > 0 = (number `mod` 10) : acc toDigitsAcc (number `div` 10)
bur there are error on both last lines of he functions.
Any tips how to solve this ?
Roelof
---
Dit e-mailbericht is gecontroleerd op virussen met Avast antivirussoftware.
http://www.avast.com
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 83, Issue 35
*****************************************