Open benkoshy opened 4 years ago
I found out that the issue is was actually to do with the order of the brackets. This was the correct answer.
y = second (getDimensions difficulty)
The all important question to be answered: is the compiler message adequate, or is it just a programmer error/ignorance?
@BKSpurgeon The message is correct, albeit a bit unclear.
The reason you get this error is that your code is parsed like so:
y = (second getDimensions) difficulty
Thus it thinks that getDimensions
should be a tuple (because you're calling second
on it), and that its second element has to be a function (because you're calling that with difficulty
).
https://package.elm-lang.org/packages/elm-lang/core/latest/Tuple
My perspective
I suspect the problem is that we are inputting a "difficulty" and returning a tuple, instead of straight away getting a tuple (without a function which takes a 'difficulty' parameter. The compiler message leaves me a little non-plussed.
My two cents.