Closed andrewtyped closed 4 years ago
I looked up how Haskell does this with arrows, like
f :: a -> b -> c
.
That syntax for declaring a function's type. The function declaration itself just looks like:
f a b c = a + b + c
And you can call it like:
f 1 2 3
Is that what I should take away - that such notation is cleaner than lox's style of
f(a)(b)(c)
?
Yup! :)
The sidebar about function currying in section 10.1 ends with:
It's not clear what we're comparing that is more or less cumbersome than lox's syntax for currying. I looked up how Haskell does this with arrows, like
f :: a -> b -> c
. Is that what I should take away - that such notation is cleaner than lox's style off(a)(b)(c)
?I'm really enjoying the book by the way, it's great we have this kind of teaching resource available.