Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
- data DotPattern = Dot Expr Term (Dom Type)
- data AbsurdPattern = Absurd Range Type
- data LHSState a = LHSState {
- _lhsTel :: Telescope
- _lhsOutPat :: [NamedArg DeBruijnPattern]
- _lhsProblem :: Problem a
- _lhsTarget :: Arg Type
- _lhsPartialSplit :: ![Maybe Int]
- 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]
- otherPatterns :: [Pattern]
- getLeftoverPatterns :: [ProblemEq] -> TCM 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...
RecordFlex [FlexibleVarKind] | From a record pattern ( |
ImplicitFlex | From a hidden formal argument or underscore ( |
DotFlex | From a dot pattern ( |
OtherFlex |
Instances
Eq FlexibleVarKind Source # | |
Defined in Agda.TypeChecking.Rules.LHS.Problem (==) :: FlexibleVarKind -> FlexibleVarKind -> Bool # (/=) :: FlexibleVarKind -> FlexibleVarKind -> Bool # | |
Show FlexibleVarKind Source # | |
Defined in Agda.TypeChecking.Rules.LHS.Problem showsPrec :: Int -> FlexibleVarKind -> ShowS # show :: FlexibleVarKind -> String # showList :: [FlexibleVarKind] -> ShowS # | |
ChooseFlex FlexibleVarKind Source # | |
Defined in Agda.TypeChecking.Rules.LHS.Problem |
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.
FlexibleVar | |
|
Instances
allFlexVars :: [IsForced] -> Telescope -> FlexibleVars Source #
data FlexChoice Source #
Instances
Eq FlexChoice Source # | |
Defined in Agda.TypeChecking.Rules.LHS.Problem (==) :: FlexChoice -> FlexChoice -> Bool # (/=) :: FlexChoice -> FlexChoice -> Bool # | |
Show FlexChoice Source # | |
Defined in Agda.TypeChecking.Rules.LHS.Problem showsPrec :: Int -> FlexChoice -> ShowS # show :: FlexChoice -> String # showList :: [FlexChoice] -> ShowS # | |
Semigroup FlexChoice Source # | |
Defined in Agda.TypeChecking.Rules.LHS.Problem (<>) :: FlexChoice -> FlexChoice -> FlexChoice # sconcat :: NonEmpty FlexChoice -> FlexChoice # stimes :: Integral b => b -> FlexChoice -> FlexChoice # | |
Monoid FlexChoice Source # | |
Defined in Agda.TypeChecking.Rules.LHS.Problem mempty :: FlexChoice # mappend :: FlexChoice -> FlexChoice -> FlexChoice # mconcat :: [FlexChoice] -> FlexChoice # |
class ChooseFlex a where Source #
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.
ProblemEq | |
|
Instances
Eq ProblemEq Source # | |
Data ProblemEq Source # | |
Defined in Agda.Syntax.Abstract gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ProblemEq -> c ProblemEq # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ProblemEq # toConstr :: ProblemEq -> Constr # dataTypeOf :: ProblemEq -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ProblemEq) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ProblemEq) # gmapT :: (forall b. Data b => b -> b) -> ProblemEq -> ProblemEq # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ProblemEq -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ProblemEq -> r # gmapQ :: (forall d. Data d => d -> u) -> ProblemEq -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ProblemEq -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ProblemEq -> m ProblemEq # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ProblemEq -> m ProblemEq # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ProblemEq -> m ProblemEq # | |
Show ProblemEq Source # | |
KillRange ProblemEq Source # | |
Defined in Agda.Syntax.Abstract | |
PrettyTCM ProblemEq Source # | |
Defined in Agda.TypeChecking.Rules.LHS.Problem | |
Subst Term ProblemEq Source # | |
Defined in Agda.TypeChecking.Substitute applySubst :: Substitution' Term -> ProblemEq -> ProblemEq Source # |
The user patterns we still have to split on.
Problem | |
|
problemInPats :: Problem a -> [Pattern] Source #
Instances
Pretty AsBinding Source # | |
PrettyTCM AsBinding Source # | |
Defined in Agda.TypeChecking.Rules.LHS.Problem | |
InstantiateFull AsBinding Source # | |
Defined in Agda.TypeChecking.Rules.LHS.Problem | |
Subst Term AsBinding Source # | |
Defined in Agda.TypeChecking.Rules.LHS.Problem applySubst :: Substitution' Term -> AsBinding -> AsBinding Source # |
data DotPattern Source #
Instances
PrettyTCM DotPattern Source # | |
Defined in Agda.TypeChecking.Rules.LHS.Problem prettyTCM :: MonadPretty m => DotPattern -> m Doc Source # | |
Subst Term DotPattern Source # | |
Defined in Agda.TypeChecking.Rules.LHS.Problem applySubst :: Substitution' Term -> DotPattern -> DotPattern Source # |
data AbsurdPattern Source #
Instances
PrettyTCM AbsurdPattern Source # | |
Defined in Agda.TypeChecking.Rules.LHS.Problem prettyTCM :: MonadPretty m => AbsurdPattern -> m Doc Source # | |
Subst Term AbsurdPattern Source # | |
Defined in Agda.TypeChecking.Rules.LHS.Problem applySubst :: Substitution' Term -> AbsurdPattern -> AbsurdPattern Source # |
State worked on during the main loop of checking a lhs. [Ulf Norell's PhD, page. 35]
LHSState | |
|
data LeftoverPatterns Source #
LeftoverPatterns | |
|
Instances
Semigroup LeftoverPatterns Source # | |
Defined in Agda.TypeChecking.Rules.LHS.Problem (<>) :: LeftoverPatterns -> LeftoverPatterns -> LeftoverPatterns # sconcat :: NonEmpty LeftoverPatterns -> LeftoverPatterns # stimes :: Integral b => b -> LeftoverPatterns -> LeftoverPatterns # | |
Monoid LeftoverPatterns Source # | |
Defined in Agda.TypeChecking.Rules.LHS.Problem | |
PrettyTCM LeftoverPatterns Source # | |
Defined in Agda.TypeChecking.Rules.LHS.Problem prettyTCM :: MonadPretty m => LeftoverPatterns -> m Doc Source # |
getLeftoverPatterns :: [ProblemEq] -> TCM 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.
:: 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.