| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Mikan.Syntax.Internal.Clause
Contents
Synopsis
- data Clause = Clause {
- clauseLHSRange :: Range
- clauseFullRange :: Range
- clauseTel :: Telescope
- namedClausePats :: NAPs
- clauseBody :: Maybe Term
- clauseType :: Maybe (Arg Type)
- clauseCatchall :: Catchall
- clauseRecursive :: ClauseRecursive
- clauseUnreachable :: Maybe Bool
- clauseEllipsis :: ExpandedEllipsis
- clauseWhereModule :: Maybe ModuleName
- clausePats :: Clause -> [Arg DeBruijnPattern]
- clausePerm :: Clause -> Maybe Permutation
- clauseArgs :: Clause -> Args
- clauseElims :: Clause -> Elims
- data ClauseRecursive
- decideRecursive :: Bool -> ClauseRecursive
- couldBeRecursive :: ClauseRecursive -> Bool
Clauses
A clause is a list of patterns and the clause body.
The telescope contains the types of the pattern variables and the de Bruijn indices say how to get from the order the variables occur in the patterns to the order they occur in the telescope. The body binds the variables in the order they appear in the telescope.
clauseTel ~ permute clausePerm (patternVars namedClausePats)
Terms in dot patterns are valid in the clause telescope.
For the purpose of the permutation and the body dot patterns count as variables. TODO: Change this!
Constructors
| Clause | |
Fields
| |
Instances
clausePats :: Clause -> [Arg DeBruijnPattern] Source #
clausePerm :: Clause -> Maybe Permutation Source #
Computes the permutation from the clause telescope to the pattern variables.
Use as fromMaybe IMPOSSIBLE . clausePerm to crash
in a controlled way if a de Bruijn index is out of scope here.
clauseArgs :: Clause -> Args Source #
Translate the clause patterns to terms with free variables bound by the clause telescope.
Precondition: no projection patterns.
clauseElims :: Clause -> Elims Source #
Translate the clause patterns to an elimination spine with free variables bound by the clause telescope.
Recursivity marks
data ClauseRecursive Source #
Does the clause body contain calls to any of the mutually recursive functions?
Constructors
| YesRecursive | Definitely a call to a mutually recursive function. |
| NotRecursive | Definitely no call to a mutually recursive function. |
| MaybeRecursive | Don't know because the analysis has not run yet. |
Instances
| Pretty ClauseRecursive Source # | |||||
Defined in Mikan.Syntax.Internal.Clause Methods pretty :: ClauseRecursive -> Doc Source # prettyPrec :: Int -> ClauseRecursive -> Doc Source # prettyList :: [ClauseRecursive] -> Doc Source # | |||||
| KillRange ClauseRecursive Source # | |||||
Defined in Mikan.Syntax.Internal.Clause Methods | |||||
| EmbPrj ClauseRecursive Source # | |||||
| Null ClauseRecursive Source # | |||||
Defined in Mikan.Syntax.Internal.Clause | |||||
| NFData ClauseRecursive Source # | |||||
Defined in Mikan.Syntax.Internal.Clause Methods rnf :: ClauseRecursive -> () # | |||||
| Bounded ClauseRecursive Source # | |||||
Defined in Mikan.Syntax.Internal.Clause | |||||
| Enum ClauseRecursive Source # | |||||
Defined in Mikan.Syntax.Internal.Clause Methods succ :: ClauseRecursive -> ClauseRecursive # pred :: ClauseRecursive -> ClauseRecursive # toEnum :: Int -> ClauseRecursive # fromEnum :: ClauseRecursive -> Int # enumFrom :: ClauseRecursive -> [ClauseRecursive] # enumFromThen :: ClauseRecursive -> ClauseRecursive -> [ClauseRecursive] # enumFromTo :: ClauseRecursive -> ClauseRecursive -> [ClauseRecursive] # enumFromThenTo :: ClauseRecursive -> ClauseRecursive -> ClauseRecursive -> [ClauseRecursive] # | |||||
| Generic ClauseRecursive Source # | |||||
Defined in Mikan.Syntax.Internal.Clause Associated Types
Methods from :: ClauseRecursive -> Rep ClauseRecursive x # to :: Rep ClauseRecursive x -> ClauseRecursive # | |||||
| Show ClauseRecursive Source # | |||||
Defined in Mikan.Syntax.Internal.Clause Methods showsPrec :: Int -> ClauseRecursive -> ShowS # show :: ClauseRecursive -> String # showList :: [ClauseRecursive] -> ShowS # | |||||
| Eq ClauseRecursive Source # | |||||
Defined in Mikan.Syntax.Internal.Clause Methods (==) :: ClauseRecursive -> ClauseRecursive -> Bool # (/=) :: ClauseRecursive -> ClauseRecursive -> Bool # | |||||
| type Rep ClauseRecursive Source # | |||||
Defined in Mikan.Syntax.Internal.Clause type Rep ClauseRecursive = D1 ('MetaData "ClauseRecursive" "Mikan.Syntax.Internal.Clause" "Mikan-2.9.0-CZbYRMbHmng2A9zjJ31VFu" 'False) (C1 ('MetaCons "YesRecursive" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "NotRecursive" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MaybeRecursive" 'PrefixI 'False) (U1 :: Type -> Type))) | |||||