| License | Apache License 2.0 |
|---|---|
| Stability | experimental |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Transpiler.Conversion
Description
Converts from to Equation using a method that: allows for recursion between multiple variables;
is suitably efficient.Lambda
Synopsis
- type Scope a = String -> Either String (Expr (ScopeTerm a))
- data RHS
- data LHS = LHS String [String]
- data Equation = Equation LHS RHS
- name :: Equation -> String
- convertRHS :: Integral a => Scope a -> RHS -> Either String (Expr (ScopeTerm a))
- convertExpression :: Integral a => [String] -> Scope a -> Equation -> Either String (Expr (ScopeTerm a))
- boolChoice :: Integral a => [Expr (ScopeTerm a)] -> Expr (ScopeTerm a)
- ensureNoDuplicates :: [Equation] -> Either String [String]
- splitInlineable :: [Equation] -> ([Equation], [Equation])
- toExpression :: Integral a => [Equation] -> Either String (Expr a)
Documentation
type Scope a = String -> Either String (Expr (ScopeTerm a)) #
Type representing return value of .makeAccessor
Represents the right hand side of an equation, which can either be a term or an application of multiple RHSses.
Represents the left hand side of an equation: an equation's name and the list of bound variables it takes.
convertRHS :: Integral a => Scope a -> RHS -> Either String (Expr (ScopeTerm a)) #
Converts the right hand side of an equation to a , given its scope.Expr a
convertExpression :: Integral a => [String] -> Scope a -> Equation -> Either String (Expr (ScopeTerm a)) #
Generates the scope of the right hand side of an equation, and then converts it.
boolChoice :: Integral a => [Expr (ScopeTerm a)] -> Expr (ScopeTerm a) #
Makes a function from which variables can be chosen, by applying and truthAccessor
to a binary structure.falseAccessor
ensureNoDuplicates :: [Equation] -> Either String [String] #
Errors with the name of a duplicate variable if it exists.
splitInlineable :: [Equation] -> ([Equation], [Equation]) #
Converts equations so that can be used, and returns inlineable and global variables
in order.identifyInlineable