In Haskell, what does it mean if a binding "shadows an existing binding"?

Posted by Alistair on Stack Overflow See other posts from Stack Overflow or by Alistair
Published on 2010-05-25T07:19:30Z Indexed on 2010/05/25 7:21 UTC
Read the original article Hit count: 358

Filed under:
|
|

I'm getting a warning from GHC when I compile:

Warning: This binding for 'pats' shadows an existing binding in the definition of 'match_ignore_ancs'

Here's the function:

match_ignore_ancs (TextPat _ c) (Text t) = c t
match_ignore_ancs (TextPat _ _) (Element _ _ _) = False
match_ignore_ancs (ElemPat _ _ _) (Text t) = False
match_ignore_ancs (ElemPat _ c pats) (Element t avs xs) =
   c t avs && match_pats pats xs

Any idea what this means and how I can fix it?

Cheers.

© Stack Overflow or respective owner

Related posts about haskell

Related posts about compiler-warnings