Safe Haskell | Safe-Inferred |
---|
Control.Compilation.Sequences
Description
Compilation Monad and combinators for quickly assembling simple compilers.
Control/Compilation/Sequences.hs
A generic compilation monad for quickly assembling simple compilers for target languages that are primarily sequences of instructions (possibly with nesting, e.g., loop constructs or procedures).
- type StateExtensionSequences a = [[a]]
- class StateExtension a => HasSequences a b where
- project :: a -> StateExtensionSequences b
- inject :: StateExtensionSequences b -> a -> a
- nest :: [b] -> Compilation a ()
- unnest :: Compilation a [b]
- depth :: Compilation a Integer
Documentation
type StateExtensionSequences a = [[a]]Source
Type synonyms and class memberships.
class StateExtension a => HasSequences a b whereSource
State extension class definition, and combinators for compiling into a sequence (possibly with nested blocks) of instructions.
Methods
project :: a -> StateExtensionSequences bSource
inject :: StateExtensionSequences b -> a -> aSource
nest :: [b] -> Compilation a ()Source
unnest :: Compilation a [b]Source