|
|
|
|
Synopsis |
|
|
|
Documentation |
|
|
|
|
The value of an expression in the base environment.
|
|
|
|
|
|
|
Constructors | | Instances | |
|
|
|
|
|
|
|
|
|
|
|
|
|
A more highly parsed type of expression
ELit (literals) are primitive (self-evaluating) expressions,
in the sense that if x is a literal, then eval x env = EvalOk x
for any environment env.
I've restricted function calls to the case where the function expression
is just a symbol, since otherwise it will be hard to visualize.
But with some thought, it may be possible to generalize
this to
ECall [Expr] -- (function:args)
| Constructors | | Instances | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Example:
ePlus_2_3 = eCall + [eInt 2, eInt 3]
|
|
|
Given an expression, return the list of names of variables
occurring n the expression
|
|
|
exprVarNames expr returns the names of variables in expr
that are UNBOUND in the base environment. This may not be ideal,
but it's a start.
|
|
|
|
|
Constructors | | Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
|
|
|
|
Convert an expression tree (back) to an expression
It will not give back the *same* expression in the case of an EList.
|
|
|
|
|
|
|
Constructors | EvalOk e | | EvalError String | | EvalUntried | |
| Instances | |
|
|
|
|
|
|
|
Constructors | | Instances | |
|
|
|
|
|
A collection of functions, typically to be saved or exported
or read from a file
| Constructors | | Instances | |
|
|
|
A function may have a name and always has an implementation
| Constructors | | Instances | |
|
|
|
|
|
|
|
|
|
|
|
Type type of a function, a tuple of (arg types, result type)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Constructors | | Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
Try to match a single type and value,
may result in binding a type variable in a new environment
or just the old environment
|
|
|
Check whether the values agree with the types (which may be abstract)
This is *probably* too lenient in the case of type variables:
it can pass a mixed-type list.
|
|
|
Determine the type of a value.
May result in a type variable.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Insert names and values from lists into an environment
|
|
|
Return to the environment prior to an extendEnv
|
|
|
|
|
|
|
Get the value of a variable from an environment
|
|
|
|
|
|
|
|
|
List of all symbols bound in the environment
|
|
|
List of all symbols bound to functions in the environment
|
|
|
All the functions in the environment
|
|
|
|
|
Apply a function fvalue to a list of actual arguments args
in an environment env and with a limited stack size stacksize
|
|
|
decideTypes tries to find the argument types and return type
of an expression considered as the body of a function,
at the same time checking for consistency of inputs and
outputs between the parts of the expression.
It returns Right (argtypes, returntype) if successful;
Left errormessage otherwise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Produced by Haddock version 2.6.1 |