Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- optimizeAst :: [ScopeMb] -> [Ast] -> Bool -> [Either AstError AstOptimised]
- fromOpti :: AstOptimised -> Ast
- data AstError = Error String Ast
- data AstOptimised
Documentation
optimizeAst :: [ScopeMb] -> [Ast] -> Bool -> [Either AstError AstOptimised] Source #
Optimize a list of Ast
and check for invalid operation:
optimization is taking place when operation have the same result no matter
what for exemple `3 + 3`, when a forbidden operation is taking place, the
optimization results in an AstError
, when the optimization was a success
it results in an AstOptimised
.
Takes the stack (`[ScopeMb]`), a list of Ast
, a boolean to indicate
whether the optimization take place insinde a function and returns the
list of Either
AstError
or AstOptimised
fromOpti :: AstOptimised -> Ast Source #
Get the Ast
contained in a AstOptimised
data AstOptimised Source #
Result Ast | The |
Warning String Ast | When the optimization throw a warning
contains the warining message and the |
Instances
Show AstOptimised Source # | |
Defined in AstOptimizer showsPrec :: Int -> AstOptimised -> ShowS # show :: AstOptimised -> String # showList :: [AstOptimised] -> ShowS # | |
Eq AstOptimised Source # | |
Defined in AstOptimizer (==) :: AstOptimised -> AstOptimised -> Bool # (/=) :: AstOptimised -> AstOptimised -> Bool # |