quadraticRoots :: Floating t => t -> t -> t -> (t, t)
quadraticRoots a b c = if d < 0 then error "0" else (x, y)
where
x = e + sqrt d / (2 * a)
y = e - sqrt d / (2 * a)
d = b * b - 4 * a * c
e = - b / (2 * a)
The above code gives the following error in Hugs:
Cannot justify constraints in explicitly typed binding
*** Expression : quadraticRoots
*** Type : Floating a => a -> a -> a -> (a,a)
*** Given context : Floating a
*** Constraints : Ord a
Can anyone help me interpret this?