When I compile the following code with GHC (using the -Wall
flag):
module Main where
data Tree a = EmptyTree | Node a (Tree a) (Tree a) derivin
It's because the pattern matching is incomplete. There's no guarantee that one of x==a
, x, or
x>a
holds. For instance, if the type is Double
and x
is NaN then none of them are True
.