Safe Haskell | Safe-Inferred |
---|
Compilation Monad and combinators for quickly assembling simple compilers.
Control/Compilation/String.hs
A generic compilation monad and combinators for quickly assembling simple compilers that emit an ASCII string representation of the target language (well-suited for direct syntax translators).
- type Indentation = Integer
- type StateExtensionString = (Indentation, String)
- class StateExtension a => HasString a where
- project :: a -> StateExtensionString
- inject :: StateExtensionString -> a -> a
- indent :: Compilation a ()
- unindent :: Compilation a ()
- space :: Compilation a ()
- spaces :: Int -> Compilation a ()
- newline :: Compilation a ()
- newlines :: Int -> Compilation a ()
- string :: String -> Compilation a ()
- raw :: String -> Compilation a ()
- compiled :: Compilation a b -> String
Documentation
type Indentation = IntegerSource
Type synonyms and class memberships.
type StateExtensionString = (Indentation, String)Source
class StateExtension a => HasString a whereSource
State extension class definition, including combinators and convenient synonyms for compiling directly into a raw ASCII string.
project :: a -> StateExtensionStringSource
inject :: StateExtensionString -> a -> aSource
indent :: Compilation a ()Source
unindent :: Compilation a ()Source
space :: Compilation a ()Source
spaces :: Int -> Compilation a ()Source
newline :: Compilation a ()Source
newlines :: Int -> Compilation a ()Source
string :: String -> Compilation a ()Source
raw :: String -> Compilation a ()Source
compiled :: Compilation a b -> StringSource