Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Multiple variables recognised as parsing error

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.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading