Non-exhaustive patterns in function typeToInstance
Wenn ich versuche ein Modul mit Datentypdefinitionen zu laden, erhalte ich den obigen Fehler. Wie es aussieht, wird bei der Generierung der Arbitrary-Instanzen derzeit ein Fall noch nicht berücksichtigt.
Getestet habe ich dies mit folgendem einfachen Programm:
{-# DRHASKELL LEVEL2 #-}
data Tree a = Leaf a | Node (Tree a) (Tree a)
-- > checkExpect 17 (sumTree (Node (Node (Leaf 4) (Leaf 2)) (Node (Leaf 5) (Leaf 6))))
sumTree :: Tree Int -> Int
sumTree (Leaf x) = x
sumTree (Node t1 t2) = sumTree t1 + sumTree t2
mirrorId :: Tree a -> Bool
mirrorId t = t Prelude.== mirrorTree (mirrorTree t)
-- > quickCheck mirrorId
mirrorTree :: Tree a -> Tree a
mirrorTree t = case t of
Leaf _ -> t
Node _ _ -> t