[Haskell-cafe] Patterns overlapped?

Fernando Rodriguez frr149 at easyjob.net
Sun Jan 13 13:59:28 EST 2008


Hi,

When I compile this code, ghc complains about some overlapped patterns in 
function depth.  What on Earth is ghc talking about? O:-)


data BinTree a = EmptyTree 
				| NodeBT a (BinTree a) (BinTree a)
				deriving Show
emptyBT = EmptyTree

depth emptyBT = 0
depth (NodeBT _ left right) = max (1 + depth left) (1 + depth right)





More information about the Haskell-Cafe mailing list