Safe Haskell | None |
---|---|

Language | Haskell98 |

- dataParameters :: QName -> Compile TCM Nat
- dataParametersTCM :: QName -> TCM Nat
- report :: Int -> TCM Doc -> Compile TCM ()
- piApplyM' :: Type -> Args -> TCM Type
- insertTele :: (QName, Args) -> Int -> Maybe Type -> Term -> Telescope -> Compile TCM (Telescope, (Telescope, Type, Type))
- mkCon :: QName -> Int -> Term
- unifyI :: Telescope -> FlexibleVars -> Type -> Args -> Args -> Compile TCM [Maybe Term]
- takeTele :: Int -> Telescope -> Telescope
- remForced :: [Fun] -> Compile TCM [Fun]
- forcedExpr :: [Var] -> Telescope -> Expr -> Compile TCM Expr
- replaceForced :: ([Var], [Var]) -> Telescope -> [Var] -> [Maybe Term] -> Expr -> Compile TCM Expr
- buildTerm :: Var -> Nat -> Term -> Compile TCM (Expr -> Expr, Var)
- findPosition :: Nat -> [Maybe Term] -> Compile TCM (Maybe (Nat, Term))

# Documentation

:: (QName, Args) | |

-> Int | ABS |

-> Maybe Type | If Just, it is the type to insert patterns from is nothing if we only want to delete a binding. |

-> Term | Term to replace at pos |

-> Telescope | The telescope |

-> Compile TCM (Telescope, (Telescope, Type, Type)) |

insertTele i xs t tele
tpos
tele := Gamma ; (i : T as) ; Delta
n := parameters T
xs' := xs `apply`

(take n as)
becomes
tpos
( Gamma ; xs' ; Delta[i := t] --note that Delta still reference Gamma correctly
, T as ^ (size xs')
)

we raise the type since we have added xs' new bindings before Gamma, and as can only bind to Gamma.

remForced :: [Fun] -> Compile TCM [Fun] Source #

Main function for removing pattern matching on forced variables

forcedExpr :: [Var] -> Telescope -> Expr -> Compile TCM Expr Source #

For a given expression, in a certain telescope (the list of Var) is a mapping of variable name to the telescope.

replaceForced :: ([Var], [Var]) -> Telescope -> [Var] -> [Maybe Term] -> Expr -> Compile TCM Expr Source #

replace the forcedVar with pattern matching from the outside.

buildTerm :: Var -> Nat -> Term -> Compile TCM (Expr -> Expr, Var) Source #

Given a term containg the forced var, dig out the variable by inserting the proper case-expressions.

findPosition :: Nat -> [Maybe Term] -> Compile TCM (Maybe (Nat, Term)) Source #

Find the location where a certain Variable index is by searching the constructors aswell. i.e find a term that can be transformed into a pattern that contains the same value the index. This fails if no such term is present.