@@ -0,0 +1,28 @@
1+module Reporting.Warning.CheckMatch where
2+
3+import qualified AST.Pattern as Pattern
4+import qualified AST.Literal as Literal
5+import qualified Data.Set as Set
6+import qualified AST.Variable as Var
7+
8+data Pat var
9+ = Data var [Pat var]
10+ | Record [String]
11+ | Alias String (Pat var)
12+ | Var String
13+ | Anything
14+ | Literal Literal.Literal
15+ -- It's a shame that I had to replicate the entire pattern type, but it's
16+ -- essential to have this constructor.
17+ | AnythingBut (Set.Set Literal.Literal)
18+ deriving (Show, Eq)
19+
20+type CanonicalPat =
21+ Pat Var.Canonical
22+
23+data Warning
24+ = Redundant Pattern.CanonicalPattern
25+ -- The argument is the list of patterns that would have to
26+ -- be added for the case expression to be exhaustive.
27+ | Inexhaustive [CanonicalPat]
28+