[Haskell-cafe] Non-exhaustive pattern match warning (incorrect?)

Michael Orlitzky michael at orlitzky.com
Mon Dec 26 19:21:06 CET 2011


I'm cleaning up some old projects, and hit this:

  src/Octet.hs:47:27:
    Warning: Pattern match(es) are non-exhaustive
    In a record-update construct: Patterns not matched: Octet.None

But in the source, I've checked for that case:

  class Maskable a where
    apply_mask :: a -> Maskbits -> Bit -> a

  instance Maskable Octet where
    apply_mask _ Maskbits.None _ = Octet.None
    apply_mask Octet.None _ _    = Octet.None
    apply_mask oct mask bit
        | mask == Eight = oct
        | mask == Seven = oct { b8 = bit } -- Line 47
        ...
        | otherwise = Octet.None


Am I overlooking something, or did I already match Octet.None?



More information about the Haskell-Cafe mailing list