With WinGHCi, how can one implement the following code?
soma :: Int -> Int
soma 1 = aluno 1
soma n = aluno n + soma (n-1)
I am currently writing multiline code using
:{
...
:}
but that doesn't seem to solve the issue, in this case. Also, why doesn't something as
soma x y = x + y
work, when I'm working in WinGHCi? I can only do it if I use the let
keyword
let soma x y = x + y -- valid Haskell code
although in most literature it seems people don't use it (I'm assuming it's because they are compiling the code?).
Thanks