Agda-2.4.0: A dependently typed functional programming language and proof assistant

Safe HaskellNone

Agda.TypeChecking.Patterns.Match

Synopsis

Documentation

data Match a Source

If matching is inconclusive (DontKnow) we want to know whether it is due to a particular meta variable.

Constructors

Yes Simplification [a] 
No 
DontKnow (Maybe MetaId) 

Instances

foldMatch :: forall a b. (a -> b -> ReduceM (Match Term, b)) -> [a] -> [b] -> ReduceM (Match Term, [b])Source

Instead of zipWithM, we need to use this lazy version of combining pattern matching computations.

matchCopatterns :: [NamedArg Pattern] -> [Elim] -> ReduceM (Match Term, [Elim])Source

matchCopatterns ps es matches spine es against copattern spine ps.

Returns Yes and a substitution for the pattern variables (in form of [Term]) if matching was successful.

Returns No if there was a constructor or projection mismatch.

Returns DontKnow if an argument could not be evaluated to constructor form because of a blocking meta variable.

In any case, also returns spine es in reduced form (with all the weak head reductions performed that were necessary to come to a decision).

matchCopattern :: Pattern -> Elim -> ReduceM (Match Term, Elim)Source

Match a single copattern.

matchPattern :: Pattern -> Arg Term -> ReduceM (Match Term, Arg Term)Source

Match a single pattern.

yesSimplification :: (Match a, t) -> (Match a, t)Source