Your kwad
function has three parameters of type Enum a => a
. In other words, they can take any a
as long as it is enumerable. Your mz
functions expects their values to be of type Double
. I would suggest changing the type signature of kwad
so it takes Double
arguments instead, like so:
kwad :: Double -> Double -> Double -> Either Double Bool
This guarantees that the values you put into kwad
are Double
s, and therefore suitable for your mz
functions as well!
You also need to wrap the argument to Left
in parentheses, like so:
Left (mz0 a b c)
This means that you want to put the entire mz0 a b c
result into a Left
, and not anything else.