| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
LAM.Types.Generic
Description
Generic term type and functions.
Synopsis
- type Name = Text
- type family XVar a
- type family XLet a
- type family XExt a
- data ETerm d
- pattern Let :: XLet d ~ () => [(Name, ETerm d)] -> ETerm d -> ETerm d
- showTermWithCtx :: (XVar d ~ Name, XLet d ~ ()) => (XExt d -> String) -> (Name -> String) -> ETerm d -> String
- fromDBTermCtx :: (XVar d1 ~ Name, XVar d2 ~ Int, XLet d2 ~ (), XLet d1 ~ ()) => (XExt d2 -> XExt d1) -> [Name] -> ETerm d2 -> ETerm d1
- fromDBTerm :: (XVar d1 ~ Name, XVar d2 ~ Int, XLet d2 ~ (), XLet d1 ~ (), XExt d1 ~ XExt d2) => ETerm d2 -> ETerm d1
- toDBTermCtx :: (XVar d1 ~ Name, XVar d2 ~ Int, XLet d2 ~ (), XLet d1 ~ ()) => (XExt d1 -> XExt d2) -> [Name] -> ETerm d1 -> ETerm d2
- toDBTerm :: (XVar d1 ~ Name, XVar d2 ~ Int, XLet d2 ~ (), XLet d1 ~ ()) => (XExt d1 -> XExt d2) -> ETerm d1 -> ETerm d2
Documentation
Type family for variable names.
Instances
| type XVar Trim0 # | |
| type XVar BV # | |
Defined in LAM.Types.BV | |
| type XVar BVDB # | |
Defined in LAM.Types.BV | |
| type XVar Base # | |
Defined in LAM.Types.Pure | |
| type XVar DB # | |
Defined in LAM.Types.Pure | |
Type family for extra information at let bindings (usually trimmers).
Instances
| type XLet Trim0 # | |
| type XLet BV # | |
Defined in LAM.Types.BV | |
| type XLet BVDB # | |
Defined in LAM.Types.BV | |
| type XLet Base # | |
Defined in LAM.Types.Pure | |
| type XLet DB # | |
Defined in LAM.Types.Pure | |
Type family for extra constructors (like base values).
Instances
| type XExt Trim0 # | |
| type XExt BV # | |
Defined in LAM.Types.BV | |
| type XExt BVDB # | |
Defined in LAM.Types.BV | |
| type XExt Base # | |
Defined in LAM.Types.Pure | |
| type XExt DB # | |
Defined in LAM.Types.Pure | |
Generic term datatype.
Constructors
| Var (XVar d) | |
| Lam Name (ETerm d) | |
| App (ETerm d) (XVar d) | |
| XLet (XLet d) [(Name, ETerm d)] (ETerm d) | |
| Ext !(XExt d) |
Instances
pattern Let :: XLet d ~ () => [(Name, ETerm d)] -> ETerm d -> ETerm d #
Without extra data on XLet, we can have a simplified pattern.
showTermWithCtx :: (XVar d ~ Name, XLet d ~ ()) => (XExt d -> String) -> (Name -> String) -> ETerm d -> String #
Show a term, with a special function to show free variables.
fromDBTermCtx :: (XVar d1 ~ Name, XVar d2 ~ Int, XLet d2 ~ (), XLet d1 ~ ()) => (XExt d2 -> XExt d1) -> [Name] -> ETerm d2 -> ETerm d1 #
Convert from DeBruijn to named representation in a context.
fromDBTerm :: (XVar d1 ~ Name, XVar d2 ~ Int, XLet d2 ~ (), XLet d1 ~ (), XExt d1 ~ XExt d2) => ETerm d2 -> ETerm d1 #
Convert from DeBruijn to named representation.