[Haskell-beginners] Functions in "where" block.
c.venu at aol.com
Thu Jun 12 01:54:42 UTC 2014
I can't figure out why the following function does not work:
myFun :: Integer -> Integer
myFun x = op x + ep x
where op x = 99
ep x = 1 -- squawks here
Yeah it's a stupid function, but I was just trying to declare two functions in the "where" block. I expected
this to work and always return 100.
This is the error I get while compiling:
Prelude> :l fun.hs
[1 of 1] Compiling Main ( fun.hs, interpreted )
fun.hs:4:15: parse error on input `='
Failed, modules loaded: none.
Could someone please tell me where I am going wrong?
Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners