Re: [elm-discuss] Starting Elm, need help understanding -> syntax

2017-02-13 Thread Max Goldstein
Yes, exactly, functions always take exactly one argument and return exactly one result. A few caveats, though. Either that argument or result can be a tuple or record that holds multiple values. And the result may itself be a function, hence currying. -- You received this message because

Re: [elm-discuss] Starting Elm, need help understanding -> syntax

2017-02-13 Thread Will Tian
Yep, that makes perfect sense. I did not realize that in Elm all functions take exactly one argument and return a result -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an

Re: [elm-discuss] Starting Elm, need help understanding -> syntax

2017-02-13 Thread Eduardo Cuducos
Hi Will, If you think about currying it starts to make more sense — at least that worked for me: In add = x + y, for example, add 2 + 40 actually returns 42 (an Int) but add 2 returns function that takes one argument (Int -> Int). In other words: add

[elm-discuss] Starting Elm, need help understanding -> syntax

2017-02-13 Thread Will Tian
Hi, I am having trouble understanding the -> syntax in elm. For example if we have the function: plusTwo x = x + 2 it's type definition will be as follows: : number -> number this is pretty straight forward however, if we have the function add x y = x + y its type definition is: :