[Haskell-cafe] Redundant/overlapping patterns?

Todd Wilson twilson at csufresno.edu
Thu Jul 20 04:24:20 UTC 2023


Hi, Cafe,

Can someone please explain this:

ghci> case 1 of 2 -> 3

<interactive>:1:11: warning: [-Woverlapping-patterns]
    Pattern match is redundant
    In a case alternative: 2 -> ...
*** Exception: <interactive>:1:1-16: Non-exhaustive patterns in case

The non-exhaustive patterns part is obvious, but what is redundant about
this match? And how can there be overlapping patterns when there's only one?

Todd Wilson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20230719/c24e542c/attachment.html>


More information about the Haskell-Cafe mailing list