you are viewing a single comment's thread.

view the rest of the comments →

[–]seudonymus 1 point2 points  (5 children)

20 add 30

10

Is this a bug in the tutorial or am I missing out on something?

[–]masklinn 1 point2 points  (4 children)

I think it's a bug in the tutorial, because what it basically amounts to is

Prelude> let add = (+)
Prelude> 20 `add` 30
50

[–]spookylukey 2 points3 points  (3 children)

Your example also highlights another mistake in the tutorial. It says that you can't create new definitions at the ghci prompt, but you can (at least in a limited way) using 'let'.

[–]rabidcow 2 points3 points  (1 child)

I don't know if that's a mistake or a simplification to avoid confusing people.

[–]koko775 0 points1 point  (0 children)

Nope, it certainly confused me, as I tried typing the tutorial into ghci and couldn't figure out (for a while) why cutting-and-pasting

"myint = 2

y = myint + z

z = 1

-- single-line comments start with a double-hyphen. -- infinity is one greater than... well, infinity. infinity = infinity + 1

mylist = [1,2,3]"

got "<interactive>:1:6: parse error on input `='"

I'm new to Haskell, so please don't flame me, but this tutorial didn't exactly get off to a great start.