diff --git a/Control/Compilation.hs b/Control/Compilation.hs
new file mode 100644
--- /dev/null
+++ b/Control/Compilation.hs
@@ -0,0 +1,83 @@
+----------------------------------------------------------------
+--
+-- | Compilation
+--   Monad and combinators for quickly assembling simple
+--   compilers.
+--
+-- @Control\/Compilation.hs@
+--
+--   A generic compilation monad for quickly assembling simple
+--   compilers.
+--
+
+----------------------------------------------------------------
+--
+
+module Control.Compilation
+  where
+
+----------------------------------------------------------------
+-- | Data types, class declarations, and class memberships.
+
+type FreshIndex = Integer
+type Indentation = String
+type ModuleName = String
+type NestingDepth = Integer
+
+data State a =
+  State
+    FreshIndex
+    Indentation
+    (Maybe ModuleName)
+    NestingDepth
+    a     -- State data structure.
+
+class StateExtension a where
+  initial :: a
+
+type Compile a b = Compilation a b
+data Compilation a b = 
+    Compilation (State a -> (State a, b))
+  | Error String
+
+-- | Standard state monad definition.
+instance StateExtension a => Monad (Compilation a) where
+  return x = Compilation (\s -> (s, x))
+  (>>=) fc1 fc2 = 
+    case fc1 of
+      Compilation c1 ->
+        Compilation $
+          (\state ->
+            let (state', r) = c1 state
+                Compilation c2 = fc2 r
+            in c2 state'
+          )
+      Error err -> Error err
+
+-- | Default memberships.
+
+instance StateExtension () where
+  initial = ()
+
+----------------------------------------------------------------
+-- | Generic combinators and functions.
+
+extract :: StateExtension a => Compilation a b -> a
+extract (Compilation c) = let (State _ _ _ _ r, _) = c (State 0 "" Nothing 0 initial) in r
+
+extractFromState :: StateExtension a => a -> Compilation a b -> a
+extractFromState s (Compilation c) = let (State _ _ _ _ r, _) = c (State 0 "" Nothing 0 s) in r
+
+nothing :: Compilation a ()
+nothing = Compilation $ \s -> (s, ())
+
+get :: StateExtension a => Compilation a a
+get = Compilation $ \(State f i m n s) -> (State f i m n s, s)
+
+set :: StateExtension a => a -> Compilation a ()
+set s = Compilation $ \(State f i m n _) -> (State f i m n s, ())
+
+error :: String -> Compilation a ()
+error err = Error err
+
+--eof
diff --git a/Control/Compilation/Compile.hs b/Control/Compilation/Compile.hs
deleted file mode 100644
--- a/Control/Compilation/Compile.hs
+++ /dev/null
@@ -1,102 +0,0 @@
-----------------------------------------------------------------
---
--- Compilation
--- Monads for quickly assembling simple compilers.
---
--- Control/Compilation/Compile.hs
---   A generic compilation monad for quickly assembling simple
---   compilers.
---
-
-----------------------------------------------------------------
--- Haskell implementation of a simple compilation monad.
-
-module Control.Compilation.Compile
-  where
-
-----------------------------------------------------------------
--- Data types and class memberships.
-
-type FreshIndex = Integer
-type Indentation = String
-type ModuleName = String
-type NestingDepth = Integer
-
-data State a = 
-  State FreshIndex Indentation (Maybe ModuleName) NestingDepth a
-
-empState :: a -> State a
-empState s = State 0 "" Nothing 0 s
-
-data Compile a b = 
-  Compile (State a -> (State a, b))
-
--- Standard state monad definition.
-instance Monad (Compile a) where
-  return x = Compile (\s -> (s, x))
-  (>>=) (Compile c1) fc2 = Compile $
-    (\state ->
-      let (state', r) = c1 state
-          Compile c2 = fc2 r
-      in c2 state'
-    )
-
-----------------------------------------------------------------
--- Generic combinators and functions.
-
-extract :: Compile a () -> a -> a
-extract (Compile c) o = let (State _ _ _ _ r, _) = c (empState o) in r
-
-nothing :: Compile a ()
-nothing = Compile $ \s -> (s, ())
-
-fresh :: Compile a String
-fresh = Compile $ \(State f i m n s) -> (State (f+1) i m n s, show f)
-
-freshWithPrefix :: String -> Compile a String
-freshWithPrefix p = Compile $ \(State f i m n s) -> (State (f+1) i m n s, p ++ show f)
-
-setModule :: String -> Compile a ()
-setModule m = Compile $ \(State f i _ n s) -> (State f i (Just m) n s, ())
-
-getModule :: Compile a (Maybe String)
-getModule = Compile $ \(State f i m n s) -> (State f i m n s, m)
-
-nest :: Compile a ()
-nest = Compile $ \(State f i m n s) -> (State f i m (n+1) s, ())
-
-unnest :: Compile a ()
-unnest = Compile $ \(State f i m n s) -> (State f i m (n-1) s, ())
-
-depth :: Compile a Integer
-depth = Compile $ \(State f i m n s) -> (State f i m n s, n)
-
-----------------------------------------------------------------
--- Combinators and functions for compiling directly into a raw
--- ASCII string.
-
-indent :: Compile String ()
-indent = Compile $ \(State f i m n s) -> (State f ("  " ++ i) m n s, ())
-
-unindent :: Compile String ()
-unindent = Compile $ \(State f i m n s) -> (State f (drop (min (length i) 2) i) m n s, ())
-
-space :: Compile String ()
-space = Compile $ \(State f i m n s) -> (State f i m n (s ++ " "), ())
-
-spaces :: Int -> Compile String ()
-spaces k = Compile $ \(State f i m n s) -> (State f i m n (s ++ (take k $ repeat ' ')), ())
-
-newline :: Compile String ()
-newline = Compile $ \(State f i m n s) -> (State f i m n (s ++ "\n" ++ i), ())
-
-newlines :: Int -> Compile String ()
-newlines k = Compile $ \(State f i m n s) -> (State f i m n (s ++ (take k $ repeat '\n') ++ i), ())
-
-string :: String -> Compile String ()
-string s' = Compile $ \(State f i m n s) -> (State f i m n (s ++ s'), ())
-
-raw :: String -> Compile String ()
-raw = string
-
---eof
diff --git a/Control/Compilation/Environment.hs b/Control/Compilation/Environment.hs
new file mode 100644
--- /dev/null
+++ b/Control/Compilation/Environment.hs
@@ -0,0 +1,71 @@
+----------------------------------------------------------------
+--
+-- | Compilation
+--   Monad and combinators for quickly assembling simple
+--   compilers.
+--
+-- @Control\/Compilation\/Environment.hs@
+--
+--   State extension class and combinators for implementations
+--   of a state that support an environment (i.e., lookup table
+--   or dictionary) data structure or structures.
+--
+
+----------------------------------------------------------------
+--
+
+{-# LANGUAGE MultiParamTypeClasses, ScopedTypeVariables #-}
+
+module Control.Compilation.Environment
+  where
+
+import Control.Compilation
+
+----------------------------------------------------------------
+-- | Type synonyms.
+
+type Env a = [(String, a)]
+
+----------------------------------------------------------------
+-- | State extension class definition.
+
+class StateExtension a => Environment a b where
+  project :: a -> Env b
+  inject :: Env b -> a -> a
+
+  addEnv :: String -> b -> Compilation a ()
+  addEnv v x =
+    do s :: a <- get
+       env :: Env b <- return $ project s
+       set $ inject ((v,x):env) s
+
+  popEnv :: Compilation a ()
+  popEnv =
+    do s :: a <- get
+       env :: Env b <- return $ project s
+       set $ inject (tail env) s
+
+  dropEnv :: Int -> Compilation a ()
+  dropEnv n =
+    do s :: a <- get
+       env :: Env b <- return $ project s
+       set $ inject (drop n env) s
+
+  lookupEnv :: String -> Compilation a (Maybe b)
+  lookupEnv v =
+    do s :: a <- get
+       env :: Env b <- return $ project s
+       return $ lookup v env
+
+  setEnv :: Env b -> Compilation a ()
+  setEnv env =
+    do s :: a <- get
+       set $ inject env s
+
+  getEnv :: Compilation a (Env b)
+  getEnv =
+    do s :: a <- get
+       env :: Env b <- return $ project s
+       return $ env
+
+--eof
diff --git a/Control/Compilation/Fresh.hs b/Control/Compilation/Fresh.hs
new file mode 100644
--- /dev/null
+++ b/Control/Compilation/Fresh.hs
@@ -0,0 +1,66 @@
+----------------------------------------------------------------
+--
+-- | Compilation
+--   Monad and combinators for quickly assembling simple
+--   compilers.
+--
+-- @Control\/Compilation\/Fresh.hs@
+--
+--   State extension class and combinators for implementations
+--   of a state that support generation of fresh (i.e., unique)
+--   values (integers and strings).
+--
+
+----------------------------------------------------------------
+--
+
+module Control.Compilation.Fresh
+  where
+
+import Control.Compilation
+
+----------------------------------------------------------------
+-- | State extension class definition, including combinators
+--   and convenient synonyms.
+
+class StateExtension a => Fresh a where
+  project :: a -> Integer
+  inject :: Integer -> a -> a
+
+  freshInteger :: Compilation a Integer
+  freshInteger =
+    do s <- get
+       i <- return $ project s
+       set $ inject (i+1) s
+       return $ i
+
+  freshString :: Compilation a String
+  freshString =
+    do i <- freshInteger
+       return $ show i
+
+  freshStringWithPrefix :: String -> Compilation a String
+  freshStringWithPrefix prefix =
+    do s <- freshString
+       return $ prefix ++ s
+
+  freshWithPrefix :: String -> Compilation a String
+  freshWithPrefix = freshStringWithPrefix
+
+  fresh :: Compilation a String
+  fresh = freshString
+
+  fresh_ :: String -> Compilation a String
+  fresh_ = freshStringWithPrefix
+
+  freshes :: Integer -> Compilation a [String]
+  freshes i =
+    do ns <- mapM (\_ -> fresh) [0..i-1]
+       return $ [show n | n <- ns]
+
+  freshes_ :: String -> Integer -> Compilation a [String]
+  freshes_ prefix i =
+    do ns <- mapM (\_ -> fresh) [0..i-1]
+       return $ [prefix ++ show n | n <- ns]
+
+--eof
diff --git a/Control/Compilation/Module.hs b/Control/Compilation/Module.hs
new file mode 100644
--- /dev/null
+++ b/Control/Compilation/Module.hs
@@ -0,0 +1,38 @@
+----------------------------------------------------------------
+--
+-- | Compilation
+--   Monad and combinators for quickly assembling simple
+--   compilers.
+--
+-- @Control\/Compilation\/Module.hs@
+--
+--   State extension class and combinators for implementations
+--   of a state that support module name specification.
+--
+
+----------------------------------------------------------------
+--
+
+module Control.Compilation.Module
+  where
+
+import Control.Compilation
+
+----------------------------------------------------------------
+-- | State extension class definition, including combinators.
+
+class StateExtension a => Module a where
+  project :: a -> String
+  inject :: String -> a -> a
+
+  setModule :: String -> Compilation a ()
+  setModule m =
+    do s <- get
+       set $ inject m s
+
+  getModule :: Compilation a String
+  getModule =
+    do s <- get
+       return $ project s
+
+--eof
diff --git a/Control/Compilation/Sequence.hs b/Control/Compilation/Sequence.hs
new file mode 100644
--- /dev/null
+++ b/Control/Compilation/Sequence.hs
@@ -0,0 +1,53 @@
+----------------------------------------------------------------
+--
+-- | Compilation
+--   Monad and combinators for quickly assembling simple
+--   compilers.
+--
+-- @Control\/Compilation\/Sequence.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).
+--
+
+----------------------------------------------------------------
+--
+
+{-# LANGUAGE MultiParamTypeClasses, ScopedTypeVariables #-}
+
+module Control.Compilation.Sequence
+  where
+
+import Control.Compilation
+
+----------------------------------------------------------------
+-- | State extension class definition, and combinators for
+--   compiling into a sequence (possibly with nested blocks)
+--   of instructions.
+
+class StateExtension a => Sequence a b where
+  project :: a -> [[b]]
+  inject :: [[b]] -> a -> a
+
+  nest :: [b] -> Compilation a ()
+  nest xs =
+    do s :: a <- get
+       xss :: [[b]] <- return $ project s
+       set $ inject (xs : xss) s
+
+  unnest :: Compilation a [b]
+  unnest =
+    do s :: a <- get
+       xs :: [[b]] <- return $ project s
+       set $ inject (tail $ xs) s
+       return $ head $ project s
+
+  depth :: Compilation a Integer
+  depth =
+    do s <- get
+       xss :: [[b]] <- return $ project s
+       return $ toInteger $ length xss
+
+--eof
diff --git a/Control/Compilation/String.hs b/Control/Compilation/String.hs
new file mode 100644
--- /dev/null
+++ b/Control/Compilation/String.hs
@@ -0,0 +1,51 @@
+----------------------------------------------------------------
+--
+-- | 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).
+--
+
+----------------------------------------------------------------
+--
+
+module Control.Compilation.String
+  where
+  
+import Control.Compilation
+
+----------------------------------------------------------------
+-- | Combinators and functions for compiling directly into a raw
+--   ASCII string.
+
+indent :: Compilation String ()
+indent = Compilation $ \(State f i m n s) -> (State f ("  " ++ i) m n s, ())
+
+unindent :: Compilation String ()
+unindent = Compilation $ \(State f i m n s) -> (State f (drop (min (length i) 2) i) m n s, ())
+
+space :: Compilation String ()
+space = Compilation $ \(State f i m n s) -> (State f i m n (s ++ " "), ())
+
+spaces :: Int -> Compilation String ()
+spaces k = Compilation $ \(State f i m n s) -> (State f i m n (s ++ (take k $ repeat ' ')), ())
+
+newline :: Compilation String ()
+newline = Compilation $ \(State f i m n s) -> (State f i m n (s ++ "\n" ++ i), ())
+
+newlines :: Int -> Compilation String ()
+newlines k = Compilation $ \(State f i m n s) -> (State f i m n (s ++ (take k $ repeat '\n') ++ i), ())
+
+string :: String -> Compilation String ()
+string s' = Compilation $ \(State f i m n s) -> (State f i m n (s ++ s'), ())
+
+raw :: String -> Compilation String ()
+raw = string
+
+--eof
diff --git a/Control/Compilation/Tree.hs b/Control/Compilation/Tree.hs
new file mode 100644
--- /dev/null
+++ b/Control/Compilation/Tree.hs
@@ -0,0 +1,27 @@
+----------------------------------------------------------------
+--
+-- | Compilation
+--   Monad and combinators for quickly assembling simple
+--   compilers.
+--
+-- @Control\/Compilation\/Tree.hs@
+--
+--   A generic compilation monad for quickly assembling simple
+--   compilers for target languages that are primarily
+--   expression trees.
+--
+
+----------------------------------------------------------------
+--
+
+module Control.Compilation.Tree
+  where
+
+import Control.Compilation
+
+----------------------------------------------------------------
+-- Combinator definitions.
+
+() = ()
+
+--eof
diff --git a/compilation.cabal b/compilation.cabal
--- a/compilation.cabal
+++ b/compilation.cabal
@@ -1,5 +1,5 @@
 Name:              compilation
-Version:           0.0.0.1
+Version:           0.0.0.2
 Cabal-Version:     >= 1.6
 License:           GPL-3
 License-File:      LICENSE
@@ -11,7 +11,13 @@
 Build-Type:        Simple
 
 Library
-  Exposed-Modules: Control.Compilation.Compile
+  Exposed-Modules: Control.Compilation,
+                   Control.Compilation.Fresh,
+                   Control.Compilation.Module,
+                   Control.Compilation.Environment,
+                   Control.Compilation.String,
+                   Control.Compilation.Sequence,
+                   Control.Compilation.Tree
   Build-Depends:   base >= 3 && < 5, MissingH
 
 Source-Repository head
