Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Documentation
Infix Prefix LateInfix
The LateInfix is a trick used is the eval function.
A name is a 'to be' literal In a programme, foo can be a name ( if it is not a lambda argument ). "foo" is also a name but is delimited by double quotes.
An expression of host language a.
The Lit class is for the language contained inside lambdaBase.
toLit sould take a Name and transform it to a literal of its language.
apply is for function application.
A programme
add 123 321
will be evaluated by transforming add to a literal.
Transforming 123 to a literal.
Partially apply add and 123 with the apply function.
Transforming 321 to a literal.
Apply the "add123" literal and the 321 literal.
And if the Lit instance is correct, the result should be a 444 literal.
See lambdaLit for an example of a Lit instance.