Safe Haskell | Safe |
---|---|
Language | Haskell98 |
- data Decl s p
- data Exp s p
- data Param = PParam !Name !Form
- data Form
- data Key
- type Train s p = [Car s p]
- data Car s p
- data Snv s p = SSnv ![SnvBind s p]
- data SnvBind s p
- data Ups = UUps ![UpsBump]
- type UpsBump = ((Name, Depth), Bump)
- data Ref s p
- type Name = Text
- type Nom = Integer
- type Depth = Integer
- type Bump = Integer
- data Text :: *
- makeXApps :: Exp s p -> [Exp s p] -> Exp s p
- takeXApps :: Exp s p -> Maybe (Exp s p, [Exp s p])
- makeXAbs :: [Param] -> Exp s p -> Exp s p
- nameOfParam :: Param -> Name
- formOfParam :: Param -> Form
- trainCons :: Car s p -> [Car s p] -> [Car s p]
- trainAppend :: [Car s p] -> [Car s p] -> [Car s p]
- trainApply :: [Car s p] -> Exp s p -> Exp s p
- snvApply :: Bool -> Snv s p -> Exp s p -> Exp s p
- snvOfNamesArgs :: [Name] -> [Exp s p] -> Snv s p
- pushHead :: Exp s p -> Maybe (Exp s p)
- pushDeep :: Exp s p -> Maybe (Exp s p)
Abstract Syntax
Top-level declaration, parameterised by the types of symbols and primitives.
Expression, parameterised by the types of symbols and primitives
XRef !(Ref s p) | Reference to an external thing. |
XKey !Key !(Exp s p) | Keyed expressions. |
XApp !(Exp s p) ![Exp s p] | Application of a function expression to an argument. |
XVar !Name !Depth | Variable name with a depth counter. |
XAbs ![Param] !(Exp s p) | Abstraction with a list of parameters and a body expression. |
XSub !(Train s p) !(Exp s p) | Substitution train applied to an expression. The train car at the head of the list is applied first. |
Form of argument required in application.
Expression keys (super primitives)
A car on the substitution train, parameterised by the types used for symbols and primitives.
Explicit substitution map, parameterised by the types used for symbols and primitives.
Lifting indicator, mapping name and binding depth to number of levels to lift.
A reference to some external thing.
A space efficient, packed, unboxed Unicode text type.
Compounds
makeXApps :: Exp s p -> [Exp s p] -> Exp s p Source #
Make an application of a function to the given list of arguments, suppressing the application of there are no arguments.
takeXApps :: Exp s p -> Maybe (Exp s p, [Exp s p]) Source #
Take an application of a function to a list of arguments.
makeXAbs :: [Param] -> Exp s p -> Exp s p Source #
Make an abstraction, short circuiting to the body if there are no parameters.
nameOfParam :: Param -> Name Source #
Get the name of a function parameter.
formOfParam :: Param -> Form Source #
Get the argument form required by a parameter.
Substitution Trains
trainCons :: Car s p -> [Car s p] -> [Car s p] Source #
Cons a car on the front of an existing train.
If the new car is empty it will be suppressed.
If the new car can be combined with the first car on the existing train then it will be combined.
trainApply :: [Car s p] -> Exp s p -> Exp s p Source #
Wrap an expression in a substitution train. If the expression is a plain
snvApply :: Bool -> Snv s p -> Exp s p -> Exp s p Source #
Wrap a train consisting of a single simultaneous substitution around an expression.
snvOfNamesArgs :: [Name] -> [Exp s p] -> Snv s p Source #
Build a substitution from lists of names and arguments.