I just started with Haskell and first tried to write some tests. Basically, I want to define some function and call this function to check the behavior.
add :: Integer -> Integer -> Integer add ab = a+b -- Test my function add 2 3
If I load this little script in Hugs98, I get the following error:
Syntax error in declaration (unexpected `}', possibly due to bad layout)
If I delete the last line, load the script and then type "add 2 3" in the hugs interpreter, it works just fine.
So the question is, how can I put my function calls in the same script as a function definition? I just want to download the script and be able to check if it does what I expect ... I donโt want to enter them manually manually.
source share