Safe Haskell | Safe-Inferred |
---|
Compilation Monad and combinators for quickly assembling simple compilers.
Control/Compilation.hs
A generic compilation monad for quickly assembling simple compilers.
- class StateExtension a where
- initial :: a
- data State a = State a
- type Compile a b = Compilation a b
- data Compilation a b
- = Compilation (State a -> (State a, b))
- | Error String
- extract :: StateExtension a => Compilation a b -> a
- extractFromState :: StateExtension a => a -> Compilation a b -> a
- nothing :: Compilation a ()
- get :: StateExtension a => Compilation a a
- set :: StateExtension a => a -> Compilation a ()
- error :: String -> Compilation a ()
Documentation
class StateExtension a whereSource
Data types, class declarations, and class memberships.
StateExtension () | Default memberships. |
StateExtension StateExtensionFresh | |
StateExtension StateExtensionString | |
StateExtension (StateExtensionEnv a) | |
StateExtension (StateExtensionSequences a) |
type Compile a b = Compilation a bSource
data Compilation a b Source
Compilation (State a -> (State a, b)) | |
Error String |
StateExtension a => Monad (Compilation a) | Standard state monad definition. |
extract :: StateExtension a => Compilation a b -> aSource
Generic combinators and functions.
extractFromState :: StateExtension a => a -> Compilation a b -> aSource
nothing :: Compilation a ()Source
get :: StateExtension a => Compilation a aSource
set :: StateExtension a => a -> Compilation a ()Source
error :: String -> Compilation a ()Source