Typfehler im Zusammenhang mit lokalen Deklarationen
Folgendes Programm
{-# DRHASKELL LEVEL2 #-}
empty :: a -> Bool
empty _ = False
insert :: Prelude.Eq a => a -> (a -> Bool) -> a -> Bool
-- insert x s y = if y == x then True else s y
insert x s = s'
where s' y = if x == y then True else s y
führt bei mir zu einem Typfehler:
Couldn't match expected type `Prelude.Bool` with actual type `(p -> Prelude.Bool) -> p -> Prelude.Bool`!
tests/05/A1.hs: (8:52) - (8:56): Prelude.Bool
tests/05/A1.hs: (10:14) - (10:16): (p -> Prelude.Bool) -> p -> Prelude.Bool
Auf Stufe 4 lässt sich das gleiche Programm ohne Probleme laden.