Home > Net >  Multiple variables recognised as parsing error
Multiple variables recognised as parsing error

Time:11-22

Why am I getting a parse error on "a b c d"?

computeNumbers :: Float -> Int -> Int -> Float -> Float 
computerNumbers (a b c d) = ((pi * a/2 ^2) * 0.002   (((pi * a/2 ^2) * 0.001) * b)   c * 0.55) * 1.5   (if d > 0 then d * 0.9 else d)

I have tried everything from deleting every space between words to make sure that I did not use TAB by mistake and rearrange the brackets. Nothing worked so far.

CodePudding user response:

Get rid of the parentheses entirely.

Without the parens you are binding the names to the four arguments. With the parens you are matching a single argument with a pattern that does not match a Float.

  • Related