[Haskell-cafe] Patterns overlapped?

jerzy.karczmarczuk at info.unicaen.fr jerzy.karczmarczuk at info.unicaen.fr
Sun Jan 13 14:09:18 EST 2008


Fernando Rodriguez writes: 

> What on Earth is ghc talking about? O:-)  (overlapping paterns)
				
> emptyBT = EmptyTree 
> 
> depth emptyBT = 0
> depth (NodeBT _ left right) = max (1 + depth left) (1 + depth right)

GHC is always right... 

Your first clause is GENERIC, the pattern is a variable, not a constant.
Replace emptyBT by EmptyTree. 

Jerzy Karczmarczuk 




More information about the Haskell-Cafe mailing list