| Safe Haskell | Safe-Inferred | 
|---|---|
| Language | Haskell2010 | 
Agda.TypeChecking.Rules.LHS.Problem
Contents
Synopsis
- type FlexibleVars = [FlexibleVar Nat]
- data FlexibleVarKind
- data FlexibleVar a = FlexibleVar {- flexArgInfo :: ArgInfo
- flexForced :: IsForced
- flexKind :: FlexibleVarKind
- flexPos :: Maybe Int
- flexVar :: a
 
- allFlexVars :: [IsForced] -> Telescope -> FlexibleVars
- data FlexChoice
- class ChooseFlex a where- chooseFlex :: a -> a -> FlexChoice
 
- data ProblemEq = ProblemEq {- problemInPat :: Pattern
- problemInst :: Term
- problemType :: Dom Type
 
- data Problem a = Problem {- _problemEqs :: [ProblemEq]
- _problemRestPats :: [NamedArg Pattern]
- _problemCont :: LHSState a -> TCM a
 
- problemEqs :: Lens' [ProblemEq] (Problem a)
- problemRestPats :: Lens' [NamedArg Pattern] (Problem a)
- problemCont :: Lens' (LHSState a -> TCM a) (Problem a)
- problemInPats :: Problem a -> [Pattern]
- data AsBinding = AsB Name Term Type Modality
- data DotPattern = Dot Expr Term (Dom Type)
- data AbsurdPattern = Absurd Range Type
- data AnnotationPattern = Ann Expr Type
- data LHSState a = LHSState {- _lhsTel :: Telescope
- _lhsOutPat :: [NamedArg DeBruijnPattern]
- _lhsProblem :: Problem a
- _lhsTarget :: Arg Type
- _lhsPartialSplit :: ![Maybe Int]
- _lhsIndexedSplit :: !Bool
 
- lhsTel :: Lens' Telescope (LHSState a)
- lhsOutPat :: Lens' [NamedArg DeBruijnPattern] (LHSState a)
- lhsProblem :: Lens' (Problem a) (LHSState a)
- lhsTarget :: Lens' (Arg Type) (LHSState a)
- data LeftoverPatterns = LeftoverPatterns {- patternVariables :: IntMap [(Name, PatVarPosition)]
- asPatterns :: [AsBinding]
- dotPatterns :: [DotPattern]
- absurdPatterns :: [AbsurdPattern]
- typeAnnotations :: [AnnotationPattern]
- otherPatterns :: [Pattern]
 
- getLeftoverPatterns :: forall m. PureTCM m => [ProblemEq] -> m LeftoverPatterns
- getUserVariableNames :: Telescope -> IntMap [(Name, PatVarPosition)] -> ([Maybe Name], [AsBinding])
Documentation
type FlexibleVars = [FlexibleVar Nat] Source #
data FlexibleVarKind Source #
When we encounter a flexible variable in the unifier, where did it come from?
   The alternatives are ordered such that we will assign the higher one first,
   i.e., first we try to assign a DotFlex, then...
Constructors
| RecordFlex [FlexibleVarKind] | From a record pattern ( | 
| ImplicitFlex | From a hidden formal argument or underscore ( | 
| DotFlex | From a dot pattern ( | 
| OtherFlex | 
Instances
| ChooseFlex FlexibleVarKind Source # | |
| Defined in Agda.TypeChecking.Rules.LHS.Problem Methods chooseFlex :: FlexibleVarKind -> FlexibleVarKind -> FlexChoice Source # | |
| Show FlexibleVarKind Source # | |
| Defined in Agda.TypeChecking.Rules.LHS.Problem Methods showsPrec :: Int -> FlexibleVarKind -> ShowS # show :: FlexibleVarKind -> String # showList :: [FlexibleVarKind] -> ShowS # | |
| Eq FlexibleVarKind Source # | |
| Defined in Agda.TypeChecking.Rules.LHS.Problem Methods (==) :: FlexibleVarKind -> FlexibleVarKind -> Bool # (/=) :: FlexibleVarKind -> FlexibleVarKind -> Bool # | |
data FlexibleVar a Source #
Flexible variables are equipped with information where they come from, in order to make a choice which one to assign when two flexibles are unified.
Constructors
| FlexibleVar | |
| Fields 
 | |
Instances
allFlexVars :: [IsForced] -> Telescope -> FlexibleVars Source #
data FlexChoice Source #
Constructors
| ChooseLeft | |
| ChooseRight | |
| ChooseEither | |
| ExpandBoth | 
Instances
| Monoid FlexChoice Source # | |
| Defined in Agda.TypeChecking.Rules.LHS.Problem Methods mempty :: FlexChoice # mappend :: FlexChoice -> FlexChoice -> FlexChoice # mconcat :: [FlexChoice] -> FlexChoice # | |
| Semigroup FlexChoice Source # | |
| Defined in Agda.TypeChecking.Rules.LHS.Problem Methods (<>) :: FlexChoice -> FlexChoice -> FlexChoice # sconcat :: NonEmpty FlexChoice -> FlexChoice # stimes :: Integral b => b -> FlexChoice -> FlexChoice # | |
| Show FlexChoice Source # | |
| Defined in Agda.TypeChecking.Rules.LHS.Problem Methods showsPrec :: Int -> FlexChoice -> ShowS # show :: FlexChoice -> String # showList :: [FlexChoice] -> ShowS # | |
| Eq FlexChoice Source # | |
| Defined in Agda.TypeChecking.Rules.LHS.Problem | |
class ChooseFlex a where Source #
Methods
chooseFlex :: a -> a -> FlexChoice Source #
Instances
A user pattern together with an internal term that it should be equal to after splitting is complete. Special cases: * User pattern is a variable but internal term isn't: this will be turned into an as pattern. * User pattern is a dot pattern: this pattern won't trigger any splitting but will be checked for equality after all splitting is complete and as patterns have been bound. * User pattern is an absurd pattern: emptiness of the type will be checked after splitting is complete. * User pattern is an annotated wildcard: type annotation will be checked after splitting is complete.
Constructors
| ProblemEq | |
| Fields 
 | |
Instances
The user patterns we still have to split on.
Constructors
| Problem | |
| Fields 
 | |
problemInPats :: Problem a -> [Pattern] Source #
Instances
| PrettyTCM AsBinding Source # | |
| Defined in Agda.TypeChecking.Rules.LHS.Problem | |
| InstantiateFull AsBinding Source # | |
| Defined in Agda.TypeChecking.Rules.LHS.Problem | |
| Subst AsBinding Source # | |
| Defined in Agda.TypeChecking.Rules.LHS.Problem Methods applySubst :: Substitution' (SubstArg AsBinding) -> AsBinding -> AsBinding Source # | |
| Pretty AsBinding Source # | |
| type SubstArg AsBinding Source # | |
| Defined in Agda.TypeChecking.Rules.LHS.Problem | |
data DotPattern Source #
Instances
| PrettyTCM DotPattern Source # | |
| Defined in Agda.TypeChecking.Rules.LHS.Problem Methods prettyTCM :: MonadPretty m => DotPattern -> m Doc Source # | |
| Subst DotPattern Source # | |
| Defined in Agda.TypeChecking.Rules.LHS.Problem Associated Types type SubstArg DotPattern Source # Methods applySubst :: Substitution' (SubstArg DotPattern) -> DotPattern -> DotPattern Source # | |
| type SubstArg DotPattern Source # | |
| Defined in Agda.TypeChecking.Rules.LHS.Problem | |
data AbsurdPattern Source #
Instances
| PrettyTCM AbsurdPattern Source # | |
| Defined in Agda.TypeChecking.Rules.LHS.Problem Methods prettyTCM :: MonadPretty m => AbsurdPattern -> m Doc Source # | |
| Subst AbsurdPattern Source # | |
| Defined in Agda.TypeChecking.Rules.LHS.Problem Associated Types type SubstArg AbsurdPattern Source # Methods applySubst :: Substitution' (SubstArg AbsurdPattern) -> AbsurdPattern -> AbsurdPattern Source # | |
| type SubstArg AbsurdPattern Source # | |
| Defined in Agda.TypeChecking.Rules.LHS.Problem | |
data AnnotationPattern Source #
Instances
| PrettyTCM AnnotationPattern Source # | |
| Defined in Agda.TypeChecking.Rules.LHS.Problem Methods prettyTCM :: MonadPretty m => AnnotationPattern -> m Doc Source # | |
State worked on during the main loop of checking a lhs. [Ulf Norell's PhD, page. 35]
Constructors
| LHSState | |
| Fields 
 | |
data LeftoverPatterns Source #
Constructors
| LeftoverPatterns | |
| Fields 
 | |
Instances
| PrettyTCM LeftoverPatterns Source # | |
| Defined in Agda.TypeChecking.Rules.LHS.Problem Methods prettyTCM :: MonadPretty m => LeftoverPatterns -> m Doc Source # | |
| Null LeftoverPatterns Source # | |
| Defined in Agda.TypeChecking.Rules.LHS.Problem | |
| Monoid LeftoverPatterns Source # | |
| Defined in Agda.TypeChecking.Rules.LHS.Problem Methods mappend :: LeftoverPatterns -> LeftoverPatterns -> LeftoverPatterns # mconcat :: [LeftoverPatterns] -> LeftoverPatterns # | |
| Semigroup LeftoverPatterns Source # | |
| Defined in Agda.TypeChecking.Rules.LHS.Problem Methods (<>) :: LeftoverPatterns -> LeftoverPatterns -> LeftoverPatterns # sconcat :: NonEmpty LeftoverPatterns -> LeftoverPatterns # stimes :: Integral b => b -> LeftoverPatterns -> LeftoverPatterns # | |
getLeftoverPatterns :: forall m. PureTCM m => [ProblemEq] -> m LeftoverPatterns Source #
Classify remaining patterns after splitting is complete into pattern variables, as patterns, dot patterns, and absurd patterns. Precondition: there are no more constructor patterns.
Arguments
| :: Telescope | The telescope of pattern variables | 
| -> IntMap [(Name, PatVarPosition)] | The list of user names for each pattern variable | 
| -> ([Maybe Name], [AsBinding]) | 
Build a renaming for the internal patterns using variable names from the user patterns. If there are multiple user names for the same internal variable, the unused ones are returned as as-bindings. Names that are not also module parameters are preferred over those that are.