data CaseTree : ScopedCase trees in A-normal forms
i.e. we may only dispatch on variables, not expressions
Case : (idx : Nat) -> (0 _ : IsVar name idx vars) -> Term vars -> List (CaseAlt vars) -> CaseTree vars case x return scTy of { p1 => e1 ; ... }STerm : Int -> Term vars -> CaseTree varsRHS: no need for further inspection
The Int is a clause id that allows us to see which of the
initial clauses are reached in the tree
Unmatched : String -> CaseTree varserror from a partial match
Impossible : CaseTree varsAbsurd context
data CaseAlt : ScopedCase alternatives. Unlike arbitrary patterns, they can be at most
one constructor deep.
ConCase : Name -> Int -> (args : List Name) -> CaseTree (addInner vars args) -> CaseAlt varsConstructor for a data type; bind the arguments and subterms.
DelayCase : (ty : Name) -> (arg : Name) -> CaseTree (addInner vars [ty, arg]) -> CaseAlt varsLazy match for the Delay type use for codata types
ConstCase : Constant -> CaseTree vars -> CaseAlt varsMatch against a literal
DefaultCase : CaseTree vars -> CaseAlt varsCatch-all case
measure : CaseTree vars -> NatisDefault : CaseAlt vars -> Booldata Pat : TypePAs : FC -> Name -> Pat -> PatPCon : FC -> Name -> Int -> Nat -> List Pat -> PatPTyCon : FC -> Name -> Nat -> List Pat -> PatPConst : FC -> Constant -> PatPArrow : FC -> Name -> Pat -> Pat -> PatPDelay : FC -> LazyReason -> Pat -> Pat -> PatPLoc : FC -> Name -> PatPUnmatchable : FC -> ClosedTerm -> PatisPConst : Pat -> Maybe Constant0 isConPat : Pat -> Bool0 IsConPat : Pat -> TypeeqTree : CaseTree vs -> CaseTree vs' -> BoolgetRefs : Name -> CaseTree vars -> NameMap BooladdRefs : Name -> NameMap Bool -> CaseTree vars -> NameMap BoolgetMetas : CaseTree vars -> NameMap BoolmkTerm : (vars : Scope) -> Pat -> Term vars