Any Haskell pros here? I'm stuck with the following:
What am I doing wrong?
Edit: I'm stupid. Negative numbers need to be inside the parentheses.
Code:
mValue :: Float -> Float -> Float
mValue a b = ((b - 0) / (0 - a))
Main> mValue 4.0 -3.0
ERROR - Cannot infer instance
*** Instance : Fractional (Float -> Float)
*** Expression : mValue 4.0 - 3.0
What am I doing wrong?
Edit: I'm stupid. Negative numbers need to be inside the parentheses.
Code:
Main> mValue 4.0 (-3.0)
-0.75
*facepalm*