[1 of 1] Compiling Main ( prog.hs, prog.o )
prog.hs:21:30:
Couldn't match expected type `Double'
with actual type `a0 -> ((a1 -> a1) -> t0 -> a0) -> t0 -> a0 -> a0'
Relevant bindings include
x1 :: forall t. a0 -> ((a1 -> a1) -> t -> a0) -> t -> a0 -> a0
(bound at prog.hs:24:11)
Probable cause: `x1' is applied to too few arguments
In the first argument of `OneSolution', namely `x1'
In the expression: OneSolution x1
prog.hs:22:31:
Couldn't match expected type `Double'
with actual type `a0 -> ((a1 -> a1) -> t1 -> a0) -> t1 -> a0 -> a0'
Relevant bindings include
x1 :: forall t. a0 -> ((a1 -> a1) -> t -> a0) -> t -> a0 -> a0
(bound at prog.hs:24:11)
Probable cause: `x1' is applied to too few arguments
In the first argument of `TwoSoulutions', namely `x1'
In the expression: TwoSoulutions x1 x2
prog.hs:22:34:
Couldn't match expected type `Double'
with actual type `a3 -> ((a4 -> a4) -> t2 -> a3) -> t2 -> a3 -> a3'
Relevant bindings include
x2 :: forall t. a3 -> ((a4 -> a4) -> t -> a3) -> t -> a3 -> a3
(bound at prog.hs:25:11)
Probable cause: `x2' is applied to too few arguments
In the second argument of `TwoSoulutions', namely `x2'
In the expression: TwoSoulutions x1 x2
prog.hs:24:16:
No instance for (Fractional a0) arising from a use of `f'
The type variable `a0' is ambiguous
Relevant bindings include
x1 :: a0 -> ((a1 -> a1) -> t -> a0) -> t -> a0 -> a0
(bound at prog.hs:24:11)
Note: there are several potential instances:
instance Fractional Double -- Defined in `GHC.Float'
instance Fractional Float -- Defined in `GHC.Float'
instance Integral a => Fractional (GHC.Real.Ratio a)
-- Defined in `GHC.Real'
In the expression: f a b d (+)
In an equation for `x1': x1 = f a b d (+)
In an equation for `sqrtEquation':
sqrtEquation a b c
| d < 0.0 = NoSolutions
| d == 0.0 = OneSolution x1
| d > 0.0 = TwoSoulutions x1 x2
where
d = b * b - 4 * a * c
x1 = f a b d (+)
x2 = f a b d (-)
f a b d operator
= (\ a b d operator -> (operator - b sqrt d) / 2 * a)
prog.hs:24:24:
No instance for (Num a2) arising from a use of `+'
The type variable `a2' is ambiguous
Note: there are several potential instances:
instance Num Double -- Defined in `GHC.Float'
instance Num Float -- Defined in `GHC.Float'
instance Integral a => Num (GHC.Real.Ratio a)
-- Defined in `GHC.Real'
...plus three others
In the fourth argument of `f', namely `(+)'
In the expression: f a b d (+)
In an equation for `x1': x1 = f a b d (+)
prog.hs:25:16:
No instance for (Fractional a3) arising from a use of `f'
The type variable `a3' is ambiguous
Relevant bindings include
x2 :: a3 -> ((a4 -> a4) -> t -> a3) -> t -> a3 -> a3
(bound at prog.hs:25:11)
Note: there are several potential instances:
instance Fractional Double -- Defined in `GHC.Float'
instance Fractional Float -- Defined in `GHC.Float'
instance Integral a => Fractional (GHC.Real.Ratio a)
-- Defined in `GHC.Real'
In the expression: f a b d (-)
In an equation for `x2': x2 = f a b d (-)
In an equation for `sqrtEquation':
sqrtEquation a b c
| d < 0.0 = NoSolutions
| d == 0.0 = OneSolution x1
| d > 0.0 = TwoSoulutions x1 x2
where
d = b * b - 4 * a * c
x1 = f a b d (+)
x2 = f a b d (-)
f a b d operator
= (\ a b d operator -> (operator - b sqrt d) / 2 * a)
prog.hs:25:24:
No instance for (Num a5) arising from a use of `-'
The type variable `a5' is ambiguous
Note: there are several potential instances:
instance Num Double -- Defined in `GHC.Float'
instance Num Float -- Defined in `GHC.Float'
instance Integral a => Num (GHC.Real.Ratio a)
-- Defined in `GHC.Real'
...plus three others
In the fourth argument of `f', namely `(-)'
In the expression: f a b d (-)
In an equation for `x2': x2 = f a b d (-)