- data MPat
- buildMPatterns :: Permutation -> [Arg Pattern] -> [Arg MPat]
- data Match a
- choice :: Match a -> Match a -> Match a
- type MatchLit = Literal -> MPat -> Match ()
- noMatchLit :: MatchLit
- yesMatchLit :: MatchLit
- match :: [Clause] -> [Arg Pattern] -> Permutation -> Match Nat
- matchLits :: Clause -> [Arg Pattern] -> Permutation -> Bool
- matchClause :: MatchLit -> [Arg MPat] -> Nat -> Clause -> Match Nat
- matchPats :: MatchLit -> [Arg Pattern] -> [Arg MPat] -> Match ()
- matchPat :: MatchLit -> Pattern -> MPat -> Match ()
Documentation
We use a special representation of the patterns we're trying to match against a clause. In particular we want to keep track of which variables are blocking a match.
buildMPatterns :: Permutation -> [Arg Pattern] -> [Arg MPat]Source
If matching is inconclusive (Block
) we want to know which
variable is blocking the match. If a dot pattern is blocking a match
we're screwed.
match :: [Clause] -> [Arg Pattern] -> Permutation -> Match NatSource
Match the given patterns against a list of clauses