Haskell simple compilation bug
Posted
by fmsf
on Stack Overflow
See other posts from Stack Overflow
or by fmsf
Published on 2010-03-08T21:35:11Z
Indexed on
2010/04/16
18:53 UTC
Read the original article
Hit count: 382
I'm trying to run this code:
let coins = [50, 25, 10, 5, 2,1]
let candidate = 11
calculate :: [Int]
calculate = [ calculate (x+candidate) | x <- coins, x > candidate]
I've read some tutorials, and it worked out ok. I'm trying to solve some small problems to give-me a feel of the language. But I'm stuck at this.
test.hs:3:0: parse error (possibly incorrect indentation)
Can anyone tell me why? I've started with haskell today so please go easy on the explanations.
I've tried to run it like:
runghc test.hs
ghc test.hs
but with:
ghci < test.hs
it gives this one:
<interactive>:1:10: parse error on input `='
Thanks
© Stack Overflow or respective owner