
5 Feb
2015
5 Feb
'15
7:01 a.m.
Hi Roelof,
On Thu, 05 Feb 2015 12:37:12 +0100
Roelof Wobben
main :: IO () main = do toDigits 123
src/Main.hs@14:5-14:17 Couldn't match expected type ‘IO ()’ with actual type [Integer] … In a stmt of a 'do' block: toDigits 123 In the expression: do { toDigits 123 }
since your do block consists only of one expression, actually your main looks like: main :: IO () main = toDigits 123 Perhaps this explains where the problem lies. Considering, however, do-notation: The last statement of a do-block needs to be an expression of the type of the do-block. Translating do-notation to bind operator sequences[1] may be helpful in understanding this. best, Max [1] http://en.wikibooks.org/wiki/Haskell/do_notation