diff --git a/CHANGELOG b/CHANGELOG
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,10 @@
 Changelog
 ---------
 
+operational - 0.2.0.3
+
+* moved project repository to github
+
 operational - 0.2.0.0
 
 * changed name of view type to `ProgramView`
diff --git a/Setup.hs b/Setup.hs
--- a/Setup.hs
+++ b/Setup.hs
@@ -1,36 +1,2 @@
-module Main where
-
--- Cabal
 import Distribution.Simple
-
-import Distribution.Simple.Setup ( fromFlag, HaddockFlags(..) )
-import Distribution.Simple.LocalBuildInfo ( LocalBuildInfo(..) )
-import Distribution.Simple.BuildPaths ( haddockPref )
-import Distribution.Simple.Utils ( setupMessage )
-import Distribution.PackageDescription
-
-import Distribution.Verbosity 
-
--- Base
-import System.FilePath ((</>))
-import System.Directory(copyFile)
-
-
-main :: IO ()
-main = defaultMainWithHooks myHooks
-    where
-    -- also install additional HTML documentation
-    myHooks   = simpleUserHooks { postHaddock = myDocs }
-
-    -- cobbled together from the source of Distribution.Simple.Haddock
-myDocs _ flags pkg_descr lbi = do
-    let verbosity = fromFlag (haddockVerbosity flags)
-    let distPref  = fromFlag (haddockDistPref flags)
-    let target    = haddockPref distPref pkg_descr </> "Documentation.html"
-    
-    let srcFiles  = extraSrcFiles $ localPkgDescr $ lbi
-    let source    = buildDir lbi </> "doc" </> "Documentation.html"
-    
-    setupMessage verbosity "Installing extra documentation for" $
-        packageId pkg_descr
-    putStrLn (concat srcFiles) -- copyFile source target
+main = defaultMain
diff --git a/doc/Documentation.md b/doc/Documentation.md
new file mode 100644
--- /dev/null
+++ b/doc/Documentation.md
@@ -0,0 +1,248 @@
+% Documentation for the "operational" package
+% Heinrich Apfelmus
+% Sun, 18 Apr 2010 13:06:16 +0200
+
+  [tutorial]: http://themonadreader.wordpress.com/2010/01/26/issue-15/
+  [unimo]: http://web.cecs.pdx.edu/~cklin/papers/unimo-143.pdf "Chuan-kai Lin. Programming Monads Operationally with Unimo."
+  [hughes]: http://citeseer.ist.psu.edu/hughes95design.html "John Hughes. The Design of a Pretty-printing Library."
+  [prompt]: http://hackage.haskell.org/package/MonadPrompt "Ryan Ingram's Monad Prompt Package."
+
+<!-- *The HTML version of this document is generated automatically from the corresponding markdown file, don't change it!* -->
+
+Introduction
+============
+This package is based on ["The Operational Monad Tutorial"][tutorial] and this documentation describes its extension to a production-quality library. In other words, the "magic" gap between relevant paper and library implementation is documented here.
+
+Take note that this this library is only ~50 lines of code, yet the documentation even includes a proof! :-)
+
+Sources and inspiration for this library include [Chuan-kai Lin's unimo paper][unimo], [John Hughes 95][hughes], and [Ryan Ingram's `MonadPrompt` package][prompt].
+
+Using this Library
+=================
+To understand what's going on, you'll have to read ["The Operational Monad Tutorial"][tutorial]. Here, I will first and foremost note the changes with respect to the tutorial.
+
+Several advanced [example monads](./examples.html) demonstrate how to put this library to good use. In the source distribution, the corresponding source files can also be found in the `.docs/examples` folder.
+
+Changes to the `Program` type
+-----------------------------
+For efficiency reasons, the type `Program` representing a list of instructions is now *abstract*. A function `view` is used to inspect the first instruction, it returns a type
+
+    data ProgramView instr a where
+        Return :: a -> ProgramView instr a
+        (:>>=) :: instr a -> (a -> Program instr b) -> ProgramView instr b
+
+which is much like the old `Program` type, except that `Then` was renamed to `:>>=` and that the subsequent instructions stored in the second argument of `:>>=` are stored in the type `Program`, not `ProgramView`.
+ 
+To see an example of the new style, here the interpreter for the stack machine from the tutorial:
+
+    interpret :: StackProgram a -> (Stack Int -> a)
+    interpret = eval . view
+        where
+        eval :: ProgramView StackInstruction a -> (Stack Int -> a)
+        eval (Push a :>>= is) stack     = interpret (is ()) (a:stack)
+        eval (Pop    :>>= is) (a:stack) = interpret (is a ) stack
+        eval (Return a)       stack     = a
+
+So-called "view functions" like `view` are a common way of inspecting data structures that have been made abstract for reasons of efficiency; see for example `viewL` and `viewR` in [`Data.Sequence`][containers].
+
+  [containers]: http://hackage.haskell.org/package/containers-0.3.0.0
+
+Efficiency
+----------
+Compared to the original type from the tutorial, `Program` now supports `>>=` in O(1) time in most use cases. This means that left-biased nesting like
+
+    let
+        nestLeft :: Int -> StackProgram Int
+        nestLeft 0 = return 0
+        nestLeft n = nestLeft (n-1) >>= push
+    in
+        interpret (nestLeft n) []
+       
+will now take O(n) time. In contrast, the old `Program` type from the tutorial would have taken O(n^2) time, similar to `++` for lists taking quadratic time in when nested to the left.
+
+However, this does *not* hold in a *persistent* setting. In particular, the example
+
+    let
+        p  = nestLeft n
+        v1 = view p
+        v2 = view p
+        v3 = view p
+    in
+        v1 `seq` v2 `seq` v3
+
+will take O(n) time for each call of `view` instead of O(n) the first time and O(1) for the other calls. But since monads are usually used ephemerally, this is much less a restriction than it would be for lists and `++`.
+
+Monad Transformers
+------------------
+Furthermore, `Program` is actually a type synonym and expressed in terms of a monad transformer `ProgramT`
+
+    type Program instr a = ProgramT instr Identity a
+
+Likewise, `view` is a specialization of `viewT` to the identity monad. This change is transparent (except for error messages on type errors) for users who are happy with just `Program` but very convenient for those users who want to use it as a monad transformer.
+
+The key point about the transformer version `ProgramT` is that in addition to the monad laws, it automatically satisfies the lifting laws for monad transformers as well
+
+    lift . return        =  return
+    lift m >>= lift . g  =  lift (m >>= g)
+
+The corresponding view function `viewT` now returns the type `m (ViewT instr m a)`. It's not immediately apparent why this return type will do, but it's straightforward to work with, like in the following implementation of the list monad transformer:
+
+    data PlusI m a where
+        Zero :: PlusI m a
+        Plus :: ListT m a -> ListT m a -> PlusI m a
+    
+    type ListT m a = ProgramT (PlusI m) m a
+    
+    runList :: Monad m => ListT m a -> m [a]
+    runList = eval <=< viewT
+        where
+        eval :: Monad m => ProgramViewT (PlusI m) m a -> m [a]
+        eval (Return x)        = return [x]
+        eval (Zero     :>>= k) = return []
+        eval (Plus m n :>>= k) =
+            liftM2 (++) (runList (m >>= k)) (runList (n >>= k))
+
+
+Alternatives to Monad Transformers
+----------------------------------
+By the way, note that monad transformers are not the only way to build larger monads from smaller ones; a similar effect can be achieved with the direct sum of instructions sets. For instance, the monad
+
+    Program (StateI s :+: ExceptionI e) a
+
+    data (f :+: g) a = Inl (f a) | Inr (g a)  -- a fancy  Either
+
+is a combination of the state monad
+
+    type State a = Program (StateI s) a
+
+    data StateI s a where
+        Put :: s -> StateI s ()
+        Get :: StateI s s
+
+and the error monad
+
+    type Error e a = Program (ErrorI e) a
+
+    data ErrorI e a where
+        Throw :: e -> ErrorI e ()
+        Catch :: ErrorI e a -> (e -> ErrorI e a) -> ErrorI e a
+
+The "sum of signatures" approach and the `(:+:)` type constructor are advocated in [Wouter Swierstra's "Data Types a la carte"][a la carte]. Time will tell which has more merit; for now I have opted for a seamless interaction with monad transformers.
+
+  [a la carte]: http://www.cse.chalmers.se/~wouter/Publications/DataTypesALaCarte.pdf "Wouter Swierstra. Data types à la carte."
+
+
+Design and Implementation
+=========================
+Proof of the monad laws (Sketch)
+--------------------------------
+The key point of this library is of course that the `view` and `viewT` functions respect the monad laws. While this seems obvious from the definition, the proof is actually not straightforward.
+
+First, we restrict ourselves to `view`, i.e. the version without monad transformers. In fact, I don't have a full proof for the version with monad transformers, more about that in the next section.
+
+Second, we use a sloppy, but much more suitable notation, namely we write
+
+---------    -------------------------
+`>>=`         instead of `Bind`
+`return`      instead of `Lift` for the identity monad
+`i,j,k,`...   for primitive instructions
+-------------------------------------------------------------
+
+Then, the `view` function becomes
+
+    view (return a)        = Return a
+    view (return a  >>= g) = g a                           -- left unit
+    view ((m >>= f) >>= g) = view (m >>= (\x -> f x >>= g) -- associativity
+    view (i         >>= g) = i :>>= g
+    view  i                = i :>>= return                 -- right unit
+
+Clearly, `view` uses the monad laws to rewrite it's argument. But we want to show that whenever two expressions
+
+    e1,e2 :: Program instr a
+
+can be transformed into each other by rewriting them with the monad laws in *any* fashion (remember that `>>=` and `return` are constructors), then `view` will map them to the same result. More formally, we have an equivalence relation
+
+    e1 ~ e2   iff   e1 and e2 are the same modulo monad laws
+
+and want to show
+
+    e1 ~ e2  =>   view e1 = view e2    (some notion of equality)
+
+Now, this needs proof because `view` is like a term rewriting system and there is no guarantee that two equivalent terms will be rewritten to the same normal form.
+
+Trying to attack this problem with term rewriting and critical pairs is probably hopeless and not very enlightening. After all, the theorem should be obvious because two equivalent expressions should have the same *first instruction* `i`. Well, we can formalize this with the help of a *normal form*
+
+    data NF instr a where
+        Return' :: a -> NF instr a
+        (:>>=') :: instr a -> (a -> NF instr b) -> NF instr b
+
+This is the old program type and the key observation is that `NF instr` is already a monad.
+
+    instance Monad (NF inst) where
+        (Return' a) >>= g = g a
+        (m :>>=' f) >>= g = m :>>= (\x -> f x >>= g)
+
+(I'll skip the short calculation and coinduction argument that this really fulfills the monad laws.) We can define a normalization function
+
+    normalize :: Program instr a -> NF instr a
+    normalize (m >>= g)  = normalize m >>=' normalize g
+    normalize (return a) = Return' a
+    normalize  i         = i :>>=' Return'
+
+which has the now obvious property that
+
+    e1 ~ e2  =>  normalize e1 = normalize e2
+
+Now, the return type of `view` is akin to a *head normal form*, hence
+
+       normalize (view e1) = normalize (view e2) 
+    => view e1 = view e2
+
+(for some suitable extension of `normalize` to the `ProgramView` type.) But since `view` only uses monad laws to rewrite its argument, we also have
+
+    e1 ~ view e1  =>  normalize e1 = normalize (view e1)
+
+and this concludes the proof, which pretty much only showed that two equivalent expressions have the same instruction list and hence `view` gives equal results.
+
+Monad Transformers
+------------------
+The monad transformer case is more hairy, I have no proof here. (If you read this by accident: don't worry, it's still correct. This is for proof nerds only.)
+
+The main difficulty is that the equation
+
+    return = lift . return
+
+is an equation for the already existing `return` constructor and the notion of "first instruction" no longer applies. Namely, we have
+
+    m  =  return m >>= id  =  lift (return m) >>= id
+
+and it's not longer clear what a suitable normal form might be. It appears that `viewT` rewrites the term as follows
+
+      lift m >>= g
+    = lift m >>= (\x -> lift (return (g x)) >>= id)
+    = (lift m >>= lift . return . g) >>= id
+    = lift (m >>= return . g) >>= id
+
+(To be continued.)
+
+
+Other Design Choices
+====================
+Recursive type definitions with `Program`
+-----------------------------------------
+In the [unimo paper][unimo], the instructions carry an additional parameter that "unties" recursive type definition. For example, the instructions for `MonadPlus` are written
+
+    data PlusI unimo a where
+        Zero :: PlusI unimo a
+        Plus :: unimo a -> unimo a -> PlusI unimo a
+
+The type constructor variable `unimo` will be tied to `Unimo PlusI`.
+
+In this library, I have opted for the conceptually simpler approach that requires the user to tie the recursion himself
+
+    data PlusI a where
+        Zero :: PlusI a
+        Plus :: Program PlusI a -> Program PlusI a -> Plus I a
+
+I am not sure whether this has major consequences for composeablity; at the moment I believe that the former style can always be recovered from an implementation in the latter style.
+
diff --git a/doc/examples/ListT.hs b/doc/examples/ListT.hs
new file mode 100644
--- /dev/null
+++ b/doc/examples/ListT.hs
@@ -0,0 +1,56 @@
+{------------------------------------------------------------------------------
+    Control.Monad.Operational
+    
+    Example:
+    List Monad Transformer
+
+------------------------------------------------------------------------------}
+{-# LANGUAGE GADTs, Rank2Types, FlexibleInstances #-}
+module ListT where
+
+import Control.Monad
+import Control.Monad.Operational
+import Control.Monad.Trans
+
+{------------------------------------------------------------------------------
+    A direct implementation
+        type ListT m a = m [a]
+    would violate the monad laws, but we don't have that problem.
+------------------------------------------------------------------------------}
+data MPlus m a where
+    MZero :: MPlus m a
+    MPlus :: ListT m a -> ListT m a -> MPlus m a
+
+type ListT m a = ProgramT (MPlus m) m a
+
+    -- *sigh* I want to use type synonyms for type constructors, too;
+    -- GHC doesn't accept  MonadMPlus (ListT m)
+instance Monad m => MonadPlus (ProgramT (MPlus m) m) where
+    mzero     = singleton MZero
+    mplus m n = singleton (MPlus m n)
+
+runListT :: Monad m => ListT m a -> m [a]
+runListT = eval <=< viewT
+    where
+    eval :: Monad m => ProgramViewT (MPlus m) m a -> m [a]
+    eval (Return x)         = return [x]
+    eval (MZero     :>>= k) = return []
+    eval (MPlus m n :>>= k) =
+        liftM2 (++) (runListT (m >>= k)) (runListT (n >>= k))
+
+testListT :: IO [()]
+testListT = runListT $ do
+    n <- choice [1..5]
+    lift . print $ "You've chosen the number: " ++ show n
+    where
+    choice = foldr1 mplus . map return
+
+
+    -- testing the monad laws, from the Haskellwiki
+    -- http://www.haskell.org/haskellwiki/ListT_done_right#Order_of_printing
+a,b,c :: ListT IO ()
+[a,b,c] = map (lift . putChar) ['a','b','c']
+
+    -- t1 and t2 have to print the same sequence of letters
+t1 = runListT $ ((a `mplus` a) >> b) >> c
+t2 = runListT $ (a `mplus` a) >> (b >> c)
diff --git a/doc/examples/LogicT.hs b/doc/examples/LogicT.hs
new file mode 100644
--- /dev/null
+++ b/doc/examples/LogicT.hs
@@ -0,0 +1,86 @@
+{------------------------------------------------------------------------------
+    Control.Monad.Operational
+    
+    Example:
+    Oleg's  LogicT  monad transformer
+    
+    Functions to implement are taken from the corresponding paper
+    http://okmij.org/ftp/papers/LogicT.pdf
+    
+------------------------------------------------------------------------------}
+{-# LANGUAGE GADTs, Rank2Types #-}
+module LogicT (LogicT, msplit, observe, bagOfN, interleave) where
+
+import Control.Monad
+import Control.Monad.Operational
+import Control.Monad.Trans
+
+import Data.Maybe
+
+{------------------------------------------------------------------------------
+    LogicT
+    = A MonadPlus with an additional operation
+         msplit
+      which returns the first result and a computation to 
+      produce the remaining results.
+
+
+    For example, the function  msplit  satisfies the laws
+    
+        msplit mzero                 ~> return Nothing
+        msplit (return a `mplus` m)  ~> return (Just (a,m))
+    
+    It turns out that we don't have to make  msplit  a primitive,
+    we can implement it by inspection on the argument. In other
+    words,  LogicT  will be the same as the  ListT  monad transformer
+------------------------------------------------------------------------------}
+import ListT
+type LogicT m a = ListT m a
+
+    -- msplit  is the lift of a function  split  in the base monad
+msplit :: Monad m => LogicT m a -> LogicT m (Maybe (a, LogicT m a))
+msplit = lift . split
+
+    -- split  in the base monad
+split :: Monad m => LogicT m a -> m (Maybe (a, LogicT m a))
+split = eval <=< viewT
+    where
+    -- apply the laws for  msplit
+    eval :: Monad m => ProgramViewT (MPlus m) m a -> m (Maybe (a, LogicT m a))
+    eval (MZero     :>>= k) = return Nothing
+    eval (MPlus m n :>>= k) = do
+        ma <- split (m >>= k)
+        case ma of
+            Nothing     -> split (n >>= k)
+            Just (a,m') -> return $ Just (a, m' `mplus` (n >>= k))
+                                --            inefficient!
+                                -- `mplus` will add another (>>= return)
+                                -- to  n  each time it's called.
+                                -- Curing this is not easy.
+
+    -- main interpreter, section 6 in the paper
+    -- returns the first result, if any; may fail
+observe :: Monad m => LogicT m a -> m a
+observe m = (fst . fromJust) `liftM` split m
+
+{------------------------------------------------------------------------------
+    Derived functions from the paper
+------------------------------------------------------------------------------}
+    -- return the first n results, section 6
+bagOfN :: Monad m => Maybe Int -> LogicT m a -> LogicT m [a]
+bagOfN (Just n) m | n <= 0 = return []
+bagOfN n m                 = msplit m >>= bagofN'
+    where
+    bagofN' Nothing         = return []
+    bagofN' (Just (x,m'))   = (x:) `liftM` bagOfN (fmap pred  n) m'
+                            where pred n = n-1
+
+    -- interleave
+interleave :: Monad m => LogicT m a -> LogicT m a -> LogicT m a
+interleave m1 m2 = do
+    r <- msplit m1
+    case r of
+        Nothing      -> m2
+        Just (a,m1') -> return a `mplus` interleave m2 m1'
+
+
diff --git a/doc/examples/PoorMansConcurrency.hs b/doc/examples/PoorMansConcurrency.hs
new file mode 100644
--- /dev/null
+++ b/doc/examples/PoorMansConcurrency.hs
@@ -0,0 +1,63 @@
+{------------------------------------------------------------------------------
+    Control.Monad.Operational
+    
+    Example:
+    Koen Claessen's Poor Man's Concurrency Monad
+    http://www.cs.chalmers.se/~koen/pubs/entry-jfp99-monad.html
+
+------------------------------------------------------------------------------}
+{-# LANGUAGE GADTs, Rank2Types #-}
+module PoorMansConcurrency where
+
+import Control.Monad
+import Control.Monad.Operational
+import Control.Monad.Trans hiding (lift)
+
+{------------------------------------------------------------------------------
+    A concurrency monad runs several processes in parallel
+    and supports two operations
+
+        fork  -- fork a new process
+        stop  -- halt the current one
+    
+    We want this to be a monad transformer, so we also need a function  lift
+    This time, however, we cannot use the monad transformer version  ProgramT
+    because this will leave no room for interleaving different computations
+    of the base monad.
+------------------------------------------------------------------------------}
+data ProcessI m a where
+    Lift :: m a -> ProcessI m a
+    Stop :: ProcessI m a
+    Fork :: Process m () -> ProcessI m ()
+
+
+type Process m a = Program (ProcessI m) a
+
+stop = singleton Stop
+fork = singleton . Fork
+lift = singleton . Lift
+
+    -- interpreter
+runProcess :: Monad m => Process m a -> m ()
+runProcess m = schedule [m]
+    where
+    schedule (x:xs) = run (view x) xs
+
+    run :: Monad m => ProgramView (ProcessI m) a -> [Process m a] -> m ()
+    run (Return _)      xs = return ()                 -- process finished
+    run (Lift m :>>= k) xs = m >>= \a ->               -- switch process
+                             schedule (xs ++ [k a])
+    run (Stop   :>>= k) xs = schedule xs               -- process halts
+    run (Fork p :>>= k) xs = schedule (xs ++ [x2,x1])  -- fork new process
+        where x1 = k (); x2 = p >>= k
+
+    -- example
+    --      > runProcess example   -- warning: runs indefinitely
+example :: Process IO ()
+example = do
+        write "Start!"
+        fork (loop "fish")
+        loop "cat"
+
+write  = lift . putStr
+loop s = write s >> loop s
diff --git a/doc/examples/State.hs b/doc/examples/State.hs
new file mode 100644
--- /dev/null
+++ b/doc/examples/State.hs
@@ -0,0 +1,60 @@
+{------------------------------------------------------------------------------
+    Control.Monad.Operational
+    
+    Example:
+    State monad and monad transformer
+    
+------------------------------------------------------------------------------}
+{-# LANGUAGE GADTs, Rank2Types, FlexibleInstances #-}
+module State where
+
+import Control.Monad
+import Control.Monad.Operational
+import Control.Monad.Trans
+
+{------------------------------------------------------------------------------
+	State Monad
+------------------------------------------------------------------------------}
+data StateI s a where
+    Get :: StateI s s
+    Put :: s -> StateI s ()
+
+type State s a = Program (StateI s) a
+
+evalState :: State s a -> s -> a
+evalState = eval . view
+    where
+    eval :: ProgramView (StateI s) a -> (s -> a)
+    eval (Return x)     = const x
+    eval (Get   :>>= k) = \s -> evalState (k s ) s
+    eval (Put s :>>= k) = \_ -> evalState (k ()) s
+
+put :: s -> StateT s m ()
+put = singleton . Put
+
+get :: StateT s m s
+get = singleton Get
+
+testState :: Int -> Int
+testState = evalState $ do
+        x <- get
+        put (x+2)
+        get
+
+{------------------------------------------------------------------------------
+    State Monad Transformer
+------------------------------------------------------------------------------}
+type StateT s m a = ProgramT (StateI s) m a
+
+evalStateT :: Monad m => StateT s m a -> s -> m a
+evalStateT m = \s -> viewT m >>= \p -> eval p s
+    where
+    eval :: Monad m => ProgramViewT (StateI s) m a -> (s -> m a)
+    eval (Return x)     = \_ -> return x
+    eval (Get   :>>= k) = \s -> evalStateT (k s ) s
+    eval (Put s :>>= k) = \_ -> evalStateT (k ()) s
+
+testStateT = evalStateT $ do
+    x <- get
+    lift $ putStrLn "Hello StateT"
+    put (x+1)
diff --git a/doc/examples/TicTacToe.hs b/doc/examples/TicTacToe.hs
new file mode 100644
--- /dev/null
+++ b/doc/examples/TicTacToe.hs
@@ -0,0 +1,175 @@
+{------------------------------------------------------------------------------
+    Control.Monad.Operational
+    
+    Example:
+    An implementation of the game TicTacToe.
+    
+    Each player (human, AI, ...) is implemented in a separate monad
+    which are then intermingled to run the game. This resembles the
+    PoorMansConcurrency.hs example.
+    
+    
+    Many thanks to Yves Par`es and Bertram Felgenhauer
+    http://www.haskell.org/pipermail/haskell-cafe/2010-April/076216.html
+
+------------------------------------------------------------------------------}
+{-# LANGUAGE GADTs, Rank2Types #-}
+
+import Control.Monad
+import Control.Monad.Operational
+import Control.Monad.State
+
+import Data.Either
+import Data.List
+
+    -- external libraries needed
+import System.Random
+
+{------------------------------------------------------------------------------
+    The Player monad for implementing players (human, AI, ...)
+    provides two operations
+    
+        readBoard   -- read the current board position
+        playMove    -- play a move
+
+    to query the current board position and perform a move, respectively.
+    
+    Moreover, it's actually a monad transformer intended to be used over IO.
+    This way, the players can perform IO computations.
+------------------------------------------------------------------------------}
+data PlayerI a where
+    ReadBoard :: PlayerI Board
+    PlayMove  :: Int -> PlayerI Bool
+    
+type Player m a = ProgramT PlayerI m a
+
+readBoard = singleton ReadBoard
+playMove  = singleton . PlayMove
+
+    -- interpreter
+runGame :: Player IO () -> Player IO () -> IO ()
+runGame player1 player2 = eval' initialGameState player1 player2
+    where
+    eval' game p1 p2 = viewT p1 >>= \p1view -> eval game p1view p2
+    
+    eval :: GameState
+         -> ProgramViewT PlayerI IO () -> Player IO ()
+         -> IO ()
+    eval game (Return _)            _  = return ()
+    eval game (ReadBoard   :>>= p1) p2 = eval' game (p1 (board game)) p2
+    eval game (PlayMove mv :>>= p1) p2 =
+        case makeMove mv game of
+            Nothing         -> eval' game (p1 False) p2
+            Just game'
+                | won game' -> let p = activePlayer game in
+                               putStrLn $ "Player " ++ show p ++ " has won!"
+                | draw game'-> putStrLn $ "It's a draw."
+                | otherwise -> eval' game' p2 (p1 True)
+    
+    -- example: human vs AI
+main = do
+    g <- getStdGen
+    runGame playerHuman (playerAI g)
+
+{------------------------------------------------------------------------------
+    TicTacToe Board type and logic
+    
+    The board looks like this:
+    
+    +---+---+---+   some squares already played on
+    | 1 | 2 | 3 |   the empty squares are numbered
+    +---+---+---+
+    | 4 | 5 |OOO|
+    +---+---+---+
+    | 7 |XXX| 9 |
+    +---+---+---+
+------------------------------------------------------------------------------}
+data Symbol = X | O deriving (Eq,Show)
+type Square = Either Int Symbol
+type Board = [[Square]]
+data GameState = Game { board :: Board, activePlayer :: Symbol }
+
+initialGameState :: GameState
+initialGameState = Game (map (map Left) [[1,2,3],[4,5,6],[7,8,9]]) X
+
+    -- list the possible moves to play
+possibleMoves :: Board -> [Int]
+possibleMoves board = [k | Left k <- concat board]
+
+    -- play a stone at a square
+makeMove :: Int -> GameState -> Maybe GameState
+makeMove k (Game board player)
+    | not (k `elem` possibleMoves board) = Nothing   -- illegal move
+    | otherwise = Just $ Game (map (map replace) board) (switch player)
+    where
+    replace (Left k') | k' == k = Right player
+    replace x                   = x
+
+    switch X = O
+    switch O = X
+
+    -- has somebody won the game?
+won :: GameState -> Bool
+won (Game board _) = any full $ diagonals board ++ rows board ++ cols board
+    where
+    full [a,b,c] = a == b && b == c
+    diagonals [[a1,_,b1],
+               [_ ,c,_ ],
+               [b2,_,a2]] = [[a1,c,a2],[b1,c,b2]]
+    rows = id
+    cols = transpose
+
+    -- is the game a draw?
+draw :: GameState -> Bool
+draw (Game board _) = null (possibleMoves board)
+
+    -- print the board
+showSquare = either (\n -> " " ++ show n ++ " ") (concat . replicate 3 . show)
+
+showBoard :: Board -> String
+showBoard board =
+      unlines . surround "+---+---+---+"
+    . map (concat . surround "|". map showSquare)
+    $ board
+    where
+    surround x xs = [x] ++ intersperse x xs ++ [x]
+
+printBoard = putStr . showBoard
+
+{------------------------------------------------------------------------------
+    Player examples
+------------------------------------------------------------------------------}
+    -- a human player on the command line
+playerHuman :: Player IO ()
+playerHuman = forever $ readBoard >>= liftIO . printBoard >> doMove
+    where
+    -- ask the player where to move
+    doMove :: Player IO ()
+    doMove = do
+        liftIO . putStrLn $ "At which number would you like to play?"
+        n <- liftIO getLine
+        b <- playMove (read n)
+        unless b $ do
+            liftIO . putStrLn $ "Position " ++ show n ++ " is already full."
+            doMove
+
+    -- a random AI,
+    -- also demonstrates how to use a custom StateT on top
+    --   of the Player monad
+playerAI :: Monad m => StdGen -> Player m ()
+playerAI = evalStateT ai
+    where
+    ai :: Monad m => StateT StdGen (ProgramT PlayerI m) ()
+    ai = forever $ do
+        board <- lift $ readBoard
+        n     <- uniform (possibleMoves board) -- select a random move
+        lift $ playMove n
+        where
+        -- select one element at random
+        uniform :: Monad m => [a] -> StateT StdGen m a
+        uniform xs = do
+            gen <- get
+            let (n,gen') = randomR (1,length xs) gen
+            put gen'
+            return (xs !! (n-1))
+
diff --git a/doc/examples/WebSessionState.lhs b/doc/examples/WebSessionState.lhs
new file mode 100644
--- /dev/null
+++ b/doc/examples/WebSessionState.lhs
@@ -0,0 +1,102 @@
+#!/bin/sh runghc
+\begin{code}
+{------------------------------------------------------------------------------
+    Control.Monad.Operational
+    
+    Example:
+    A CGI script that maintains session state
+    http://www.informatik.uni-freiburg.de/~thiemann/WASH/draft.pdf
+
+------------------------------------------------------------------------------}
+{-# LANGUAGE GADTs, Rank2Types #-}
+module WebSessionState where
+
+import Control.Monad
+import Control.Monad.Operational
+import Control.Monad.Trans hiding (lift)
+
+import Data.Char
+import Data.Maybe
+
+    -- external libraries needed
+import Text.Html as H
+import Network.CGI
+
+{------------------------------------------------------------------------------
+    This example shows a "magic" implementation of a web session that
+    looks like it needs to be executed in a running process,
+    while in fact it's just a CGI script.
+    
+    The key part is a monad, called "Web" for lack of imagination,
+    which supports a single operation
+    
+        ask :: String -> Web String
+    
+    which sends a simple minded HTML-Form to the web user
+    and returns his answer.
+    
+    How does this work? The trick is that all previous answers
+    are logged in a hidden field of the input form.
+    The CGI script will simply replays this log when called.
+    In other words, the user state is stored in the input form.
+
+------------------------------------------------------------------------------}
+data WebI a where
+    Ask :: String -> WebI String
+
+type Web a = Program WebI a
+
+ask = singleton . Ask
+
+    -- interpreter
+runWeb :: Web H.Html -> CGI CGIResult
+runWeb m = do
+            -- fetch log
+        log' <- maybe [] (read . urlDecode) `liftM` getInput "log"
+            -- maybe append form input
+        f    <- maybe id (\answer -> (++ [answer])) `liftM` getInput "answer"
+        let log = f log'
+            -- run Web action and output result
+        output . renderHtml =<< replay m log log
+    where
+    replay = eval . view
+    
+    eval :: ProgramView WebI H.Html -> [String] -> [String] -> CGI H.Html
+    eval (Return html)         log _      = return html
+    eval (Ask question :>>= k) log (l:ls) = -- replay answer from log
+        replay (k l) log ls
+    eval (Ask question :>>= k) log []     = -- present HTML page to user
+        return $ htmlQuestion log question
+
+
+    -- HTML page with a single form
+htmlQuestion log question = htmlEnvelope $ p << question +++ x
+    where
+    x = form ! [method "post"] << (textfield "answer"
+                +++ submit "Next" ""
+                +++ hidden "log" (urlEncode $ show log))
+
+htmlMessage s = htmlEnvelope $ p << s
+
+htmlEnvelope html =
+    header << thetitle << "Web Session State demo"
+    +++ body << html
+
+
+    -- example
+example :: Web H.Html
+example = do
+    haskell <- ask "What's your favorite programming language?"
+    if map toLower haskell /= "haskell"
+        then message "Awww."
+        else do
+            ghc <- ask "What's your favorite compiler?"
+            web <- ask "What's your favorite monad?"
+            message $ "I like " ++ ghc ++ " too, but "
+                      ++ web ++ " is debatable."
+    where
+    message = return . htmlMessage
+
+main = runCGI . runWeb $ example
+
+\end{code}
diff --git a/doc/web/Documentation.html b/doc/web/Documentation.html
new file mode 100644
--- /dev/null
+++ b/doc/web/Documentation.html
@@ -0,0 +1,218 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+  <meta name="generator" content="pandoc" />
+  <meta name="author" content="Heinrich Apfelmus" />
+  <meta name="date" content="Sun, 18 Apr 2010 13:06:16 +0200" />
+  <title>Documentation for the &quot;operational&quot; package</title>
+  <link rel="stylesheet" href="fptools.css" type="text/css" />
+</head>
+<body>
+<h1 class="title">Documentation for the &quot;operational&quot; package</h1>
+<div id="TOC">
+<ul>
+<li><a href="#introduction"><span class="toc-section-number">1</span> Introduction</a></li>
+<li><a href="#using-this-library"><span class="toc-section-number">2</span> Using this Library</a><ul>
+<li><a href="#changes-to-the-program-type"><span class="toc-section-number">2.1</span> Changes to the <code>Program</code> type</a></li>
+<li><a href="#efficiency"><span class="toc-section-number">2.2</span> Efficiency</a></li>
+<li><a href="#monad-transformers"><span class="toc-section-number">2.3</span> Monad Transformers</a></li>
+<li><a href="#alternatives-to-monad-transformers"><span class="toc-section-number">2.4</span> Alternatives to Monad Transformers</a></li>
+</ul></li>
+<li><a href="#design-and-implementation"><span class="toc-section-number">3</span> Design and Implementation</a><ul>
+<li><a href="#proof-of-the-monad-laws-sketch"><span class="toc-section-number">3.1</span> Proof of the monad laws (Sketch)</a></li>
+<li><a href="#monad-transformers-1"><span class="toc-section-number">3.2</span> Monad Transformers</a></li>
+</ul></li>
+<li><a href="#other-design-choices"><span class="toc-section-number">4</span> Other Design Choices</a><ul>
+<li><a href="#recursive-type-definitions-with-program"><span class="toc-section-number">4.1</span> Recursive type definitions with <code>Program</code></a></li>
+</ul></li>
+</ul>
+</div>
+<!-- *The HTML version of this document is generated automatically from the corresponding markdown file, don't change it!* -->
+
+<h1 id="introduction"><a href="#TOC"><span class="header-section-number">1</span> Introduction</a></h1>
+<p>This package is based on <a href="http://themonadreader.wordpress.com/2010/01/26/issue-15/">&quot;The Operational Monad Tutorial&quot;</a> and this documentation describes its extension to a production-quality library. In other words, the &quot;magic&quot; gap between relevant paper and library implementation is documented here.</p>
+<p>Take note that this this library is only ~50 lines of code, yet the documentation even includes a proof! :-)</p>
+<p>Sources and inspiration for this library include <a href="http://web.cecs.pdx.edu/~cklin/papers/unimo-143.pdf" title="Chuan-kai Lin. Programming Monads Operationally with Unimo.">Chuan-kai Lin's unimo paper</a>, <a href="http://citeseer.ist.psu.edu/hughes95design.html" title="John Hughes. The Design of a Pretty-printing Library.">John Hughes 95</a>, and <a href="http://hackage.haskell.org/package/MonadPrompt" title="Ryan Ingram's Monad Prompt Package.">Ryan Ingram's <code>MonadPrompt</code> package</a>.</p>
+<h1 id="using-this-library"><a href="#TOC"><span class="header-section-number">2</span> Using this Library</a></h1>
+<p>To understand what's going on, you'll have to read <a href="http://themonadreader.wordpress.com/2010/01/26/issue-15/">&quot;The Operational Monad Tutorial&quot;</a>. Here, I will first and foremost note the changes with respect to the tutorial.</p>
+<p>Several advanced <a href="./examples.html">example monads</a> demonstrate how to put this library to good use. In the source distribution, the corresponding source files can also be found in the <code>.docs/examples</code> folder.</p>
+<h2 id="changes-to-the-program-type"><a href="#TOC"><span class="header-section-number">2.1</span> Changes to the <code>Program</code> type</a></h2>
+<p>For efficiency reasons, the type <code>Program</code> representing a list of instructions is now <em>abstract</em>. A function <code>view</code> is used to inspect the first instruction, it returns a type</p>
+<pre><code>data ProgramView instr a where
+    Return :: a -&gt; ProgramView instr a
+    (:&gt;&gt;=) :: instr a -&gt; (a -&gt; Program instr b) -&gt; ProgramView instr b
+</code></pre>
+<p>which is much like the old <code>Program</code> type, except that <code>Then</code> was renamed to <code>:&gt;&gt;=</code> and that the subsequent instructions stored in the second argument of <code>:&gt;&gt;=</code> are stored in the type <code>Program</code>, not <code>ProgramView</code>.</p>
+<p>To see an example of the new style, here the interpreter for the stack machine from the tutorial:</p>
+<pre><code>interpret :: StackProgram a -&gt; (Stack Int -&gt; a)
+interpret = eval . view
+    where
+    eval :: ProgramView StackInstruction a -&gt; (Stack Int -&gt; a)
+    eval (Push a :&gt;&gt;= is) stack     = interpret (is ()) (a:stack)
+    eval (Pop    :&gt;&gt;= is) (a:stack) = interpret (is a ) stack
+    eval (Return a)       stack     = a
+</code></pre>
+<p>So-called &quot;view functions&quot; like <code>view</code> are a common way of inspecting data structures that have been made abstract for reasons of efficiency; see for example <code>viewL</code> and <code>viewR</code> in <a href="http://hackage.haskell.org/package/containers-0.3.0.0"><code>Data.Sequence</code></a>.</p>
+<h2 id="efficiency"><a href="#TOC"><span class="header-section-number">2.2</span> Efficiency</a></h2>
+<p>Compared to the original type from the tutorial, <code>Program</code> now supports <code>&gt;&gt;=</code> in O(1) time in most use cases. This means that left-biased nesting like</p>
+<pre><code>let
+    nestLeft :: Int -&gt; StackProgram Int
+    nestLeft 0 = return 0
+    nestLeft n = nestLeft (n-1) &gt;&gt;= push
+in
+    interpret (nestLeft n) []
+</code></pre>
+<p>will now take O(n) time. In contrast, the old <code>Program</code> type from the tutorial would have taken O(n^2) time, similar to <code>++</code> for lists taking quadratic time in when nested to the left.</p>
+<p>However, this does <em>not</em> hold in a <em>persistent</em> setting. In particular, the example</p>
+<pre><code>let
+    p  = nestLeft n
+    v1 = view p
+    v2 = view p
+    v3 = view p
+in
+    v1 `seq` v2 `seq` v3
+</code></pre>
+<p>will take O(n) time for each call of <code>view</code> instead of O(n) the first time and O(1) for the other calls. But since monads are usually used ephemerally, this is much less a restriction than it would be for lists and <code>++</code>.</p>
+<h2 id="monad-transformers"><a href="#TOC"><span class="header-section-number">2.3</span> Monad Transformers</a></h2>
+<p>Furthermore, <code>Program</code> is actually a type synonym and expressed in terms of a monad transformer <code>ProgramT</code></p>
+<pre><code>type Program instr a = ProgramT instr Identity a
+</code></pre>
+<p>Likewise, <code>view</code> is a specialization of <code>viewT</code> to the identity monad. This change is transparent (except for error messages on type errors) for users who are happy with just <code>Program</code> but very convenient for those users who want to use it as a monad transformer.</p>
+<p>The key point about the transformer version <code>ProgramT</code> is that in addition to the monad laws, it automatically satisfies the lifting laws for monad transformers as well</p>
+<pre><code>lift . return        =  return
+lift m &gt;&gt;= lift . g  =  lift (m &gt;&gt;= g)
+</code></pre>
+<p>The corresponding view function <code>viewT</code> now returns the type <code>m (ViewT instr m a)</code>. It's not immediately apparent why this return type will do, but it's straightforward to work with, like in the following implementation of the list monad transformer:</p>
+<pre><code>data PlusI m a where
+    Zero :: PlusI m a
+    Plus :: ListT m a -&gt; ListT m a -&gt; PlusI m a
+
+type ListT m a = ProgramT (PlusI m) m a
+
+runList :: Monad m =&gt; ListT m a -&gt; m [a]
+runList = eval &lt;=&lt; viewT
+    where
+    eval :: Monad m =&gt; ProgramViewT (PlusI m) m a -&gt; m [a]
+    eval (Return x)        = return [x]
+    eval (Zero     :&gt;&gt;= k) = return []
+    eval (Plus m n :&gt;&gt;= k) =
+        liftM2 (++) (runList (m &gt;&gt;= k)) (runList (n &gt;&gt;= k))
+</code></pre>
+<h2 id="alternatives-to-monad-transformers"><a href="#TOC"><span class="header-section-number">2.4</span> Alternatives to Monad Transformers</a></h2>
+<p>By the way, note that monad transformers are not the only way to build larger monads from smaller ones; a similar effect can be achieved with the direct sum of instructions sets. For instance, the monad</p>
+<pre><code>Program (StateI s :+: ExceptionI e) a
+
+data (f :+: g) a = Inl (f a) | Inr (g a)  -- a fancy  Either
+</code></pre>
+<p>is a combination of the state monad</p>
+<pre><code>type State a = Program (StateI s) a
+
+data StateI s a where
+    Put :: s -&gt; StateI s ()
+    Get :: StateI s s
+</code></pre>
+<p>and the error monad</p>
+<pre><code>type Error e a = Program (ErrorI e) a
+
+data ErrorI e a where
+    Throw :: e -&gt; ErrorI e ()
+    Catch :: ErrorI e a -&gt; (e -&gt; ErrorI e a) -&gt; ErrorI e a
+</code></pre>
+<p>The &quot;sum of signatures&quot; approach and the <code>(:+:)</code> type constructor are advocated in <a href="http://www.cse.chalmers.se/~wouter/Publications/DataTypesALaCarte.pdf" title="Wouter Swierstra. Data types &#224; la carte.">Wouter Swierstra's &quot;Data Types a la carte&quot;</a>. Time will tell which has more merit; for now I have opted for a seamless interaction with monad transformers.</p>
+<h1 id="design-and-implementation"><a href="#TOC"><span class="header-section-number">3</span> Design and Implementation</a></h1>
+<h2 id="proof-of-the-monad-laws-sketch"><a href="#TOC"><span class="header-section-number">3.1</span> Proof of the monad laws (Sketch)</a></h2>
+<p>The key point of this library is of course that the <code>view</code> and <code>viewT</code> functions respect the monad laws. While this seems obvious from the definition, the proof is actually not straightforward.</p>
+<p>First, we restrict ourselves to <code>view</code>, i.e. the version without monad transformers. In fact, I don't have a full proof for the version with monad transformers, more about that in the next section.</p>
+<p>Second, we use a sloppy, but much more suitable notation, namely we write</p>
+<table>
+<tbody>
+<tr class="odd">
+<td align="left"><code>&gt;&gt;=</code></td>
+<td align="center">instead of <code>Bind</code></td>
+</tr>
+<tr class="even">
+<td align="left"><code>return</code></td>
+<td align="center">instead of <code>Lift</code> for the identity monad</td>
+</tr>
+<tr class="odd">
+<td align="left"><code>i,j,k,</code>...</td>
+<td align="center">for primitive instructions</td>
+</tr>
+</tbody>
+</table>
+<p>Then, the <code>view</code> function becomes</p>
+<pre><code>view (return a)        = Return a
+view (return a  &gt;&gt;= g) = g a                           -- left unit
+view ((m &gt;&gt;= f) &gt;&gt;= g) = view (m &gt;&gt;= (\x -&gt; f x &gt;&gt;= g) -- associativity
+view (i         &gt;&gt;= g) = i :&gt;&gt;= g
+view  i                = i :&gt;&gt;= return                 -- right unit
+</code></pre>
+<p>Clearly, <code>view</code> uses the monad laws to rewrite it's argument. But we want to show that whenever two expressions</p>
+<pre><code>e1,e2 :: Program instr a
+</code></pre>
+<p>can be transformed into each other by rewriting them with the monad laws in <em>any</em> fashion (remember that <code>&gt;&gt;=</code> and <code>return</code> are constructors), then <code>view</code> will map them to the same result. More formally, we have an equivalence relation</p>
+<pre><code>e1 ~ e2   iff   e1 and e2 are the same modulo monad laws
+</code></pre>
+<p>and want to show</p>
+<pre><code>e1 ~ e2  =&gt;   view e1 = view e2    (some notion of equality)
+</code></pre>
+<p>Now, this needs proof because <code>view</code> is like a term rewriting system and there is no guarantee that two equivalent terms will be rewritten to the same normal form.</p>
+<p>Trying to attack this problem with term rewriting and critical pairs is probably hopeless and not very enlightening. After all, the theorem should be obvious because two equivalent expressions should have the same <em>first instruction</em> <code>i</code>. Well, we can formalize this with the help of a <em>normal form</em></p>
+<pre><code>data NF instr a where
+    Return' :: a -&gt; NF instr a
+    (:&gt;&gt;=') :: instr a -&gt; (a -&gt; NF instr b) -&gt; NF instr b
+</code></pre>
+<p>This is the old program type and the key observation is that <code>NF instr</code> is already a monad.</p>
+<pre><code>instance Monad (NF inst) where
+    (Return' a) &gt;&gt;= g = g a
+    (m :&gt;&gt;=' f) &gt;&gt;= g = m :&gt;&gt;= (\x -&gt; f x &gt;&gt;= g)
+</code></pre>
+<p>(I'll skip the short calculation and coinduction argument that this really fulfills the monad laws.) We can define a normalization function</p>
+<pre><code>normalize :: Program instr a -&gt; NF instr a
+normalize (m &gt;&gt;= g)  = normalize m &gt;&gt;=' normalize g
+normalize (return a) = Return' a
+normalize  i         = i :&gt;&gt;=' Return'
+</code></pre>
+<p>which has the now obvious property that</p>
+<pre><code>e1 ~ e2  =&gt;  normalize e1 = normalize e2
+</code></pre>
+<p>Now, the return type of <code>view</code> is akin to a <em>head normal form</em>, hence</p>
+<pre><code>   normalize (view e1) = normalize (view e2) 
+=&gt; view e1 = view e2
+</code></pre>
+<p>(for some suitable extension of <code>normalize</code> to the <code>ProgramView</code> type.) But since <code>view</code> only uses monad laws to rewrite its argument, we also have</p>
+<pre><code>e1 ~ view e1  =&gt;  normalize e1 = normalize (view e1)
+</code></pre>
+<p>and this concludes the proof, which pretty much only showed that two equivalent expressions have the same instruction list and hence <code>view</code> gives equal results.</p>
+<h2 id="monad-transformers-1"><a href="#TOC"><span class="header-section-number">3.2</span> Monad Transformers</a></h2>
+<p>The monad transformer case is more hairy, I have no proof here. (If you read this by accident: don't worry, it's still correct. This is for proof nerds only.)</p>
+<p>The main difficulty is that the equation</p>
+<pre><code>return = lift . return
+</code></pre>
+<p>is an equation for the already existing <code>return</code> constructor and the notion of &quot;first instruction&quot; no longer applies. Namely, we have</p>
+<pre><code>m  =  return m &gt;&gt;= id  =  lift (return m) &gt;&gt;= id
+</code></pre>
+<p>and it's not longer clear what a suitable normal form might be. It appears that <code>viewT</code> rewrites the term as follows</p>
+<pre><code>  lift m &gt;&gt;= g
+= lift m &gt;&gt;= (\x -&gt; lift (return (g x)) &gt;&gt;= id)
+= (lift m &gt;&gt;= lift . return . g) &gt;&gt;= id
+= lift (m &gt;&gt;= return . g) &gt;&gt;= id
+</code></pre>
+<p>(To be continued.)</p>
+<h1 id="other-design-choices"><a href="#TOC"><span class="header-section-number">4</span> Other Design Choices</a></h1>
+<h2 id="recursive-type-definitions-with-program"><a href="#TOC"><span class="header-section-number">4.1</span> Recursive type definitions with <code>Program</code></a></h2>
+<p>In the <a href="http://web.cecs.pdx.edu/~cklin/papers/unimo-143.pdf" title="Chuan-kai Lin. Programming Monads Operationally with Unimo.">unimo paper</a>, the instructions carry an additional parameter that &quot;unties&quot; recursive type definition. For example, the instructions for <code>MonadPlus</code> are written</p>
+<pre><code>data PlusI unimo a where
+    Zero :: PlusI unimo a
+    Plus :: unimo a -&gt; unimo a -&gt; PlusI unimo a
+</code></pre>
+<p>The type constructor variable <code>unimo</code> will be tied to <code>Unimo PlusI</code>.</p>
+<p>In this library, I have opted for the conceptually simpler approach that requires the user to tie the recursion himself</p>
+<pre><code>data PlusI a where
+    Zero :: PlusI a
+    Plus :: Program PlusI a -&gt; Program PlusI a -&gt; Plus I a
+</code></pre>
+<p>I am not sure whether this has major consequences for composeablity; at the moment I believe that the former style can always be recovered from an implementation in the latter style.</p>
+</body>
+</html>
diff --git a/doc/web/fptools.css b/doc/web/fptools.css
new file mode 100644
--- /dev/null
+++ b/doc/web/fptools.css
@@ -0,0 +1,48 @@
+body {
+    font-family: Verdana, sans-serif;
+    width: 43em;
+    margin: 1ex 3em 1ex;
+}
+
+div {
+  font-family: sans-serif;
+  color: black;
+  background: white
+}
+
+h1, h2, h3, h4, h5, h6, p.title, h1 > a:visited, h2 > a:visited, h1 > a:link, h2 > a:link { color: #005A9C; text-decoration:none; }
+
+h1 { font:            170% sans-serif; }
+h2 { font:            140% sans-serif; }
+h3 { font:            120% sans-serif; }
+h4 { font: bold       100% sans-serif; }
+h5 { font: italic     100% sans-serif; }
+h6 { font: small-caps 100% sans-serif; }
+
+pre {
+  font-family: monospace;
+  border-width: 1px;
+  border-style: solid;
+  padding: 0.3em;
+  color: maroon;
+}
+
+pre.screen         { color: #006400; }
+pre.programlisting { color: maroon; }
+
+div.example {
+  margin: 1ex 0em;
+  border: solid #412e25 1px;
+  padding: 0ex 0.4em;
+}
+
+div.example, div.example-contents {
+  background-color: #fffcf5;
+}
+
+a:link    { color:      #0000C8; }
+a:hover   { background: #FFFFA8; }
+a:active  { color:      #D00000; }
+a:visited { color:      #680098; }
+
+h1 > a { color: #000; }
diff --git a/docs/Documentation.md b/docs/Documentation.md
deleted file mode 100644
--- a/docs/Documentation.md
+++ /dev/null
@@ -1,248 +0,0 @@
-% Documentation for the "operational" package
-% Heinrich Apfelmus
-% Sun, 18 Apr 2010 13:06:16 +0200
-
-  [tutorial]: http://themonadreader.wordpress.com/2010/01/26/issue-15/
-  [unimo]: http://web.cecs.pdx.edu/~cklin/papers/unimo-143.pdf "Chuan-kai Lin. Programming Monads Operationally with Unimo."
-  [hughes]: http://citeseer.ist.psu.edu/hughes95design.html "John Hughes. The Design of a Pretty-printing Library."
-  [prompt]: http://hackage.haskell.org/package/MonadPrompt "Ryan Ingram's Monad Prompt Package."
-
-<!-- *The HTML version of this document is generated automatically from the corresponding markdown file, don't change it!* -->
-
-Introduction
-============
-This package is based on ["The Operational Monad Tutorial"][tutorial] and this documentation describes its extension to a production-quality library. In other words, the "magic" gap between relevant paper and library implementation is documented here.
-
-Take note that this this library is only ~50 lines of code, yet the documentation even includes a proof! :-)
-
-Sources and inspiration for this library include [Chuan-kai Lin's unimo paper][unimo], [John Hughes 95][hughes], and [Ryan Ingram's `MonadPrompt` package][prompt].
-
-Using this Library
-=================
-To understand what's going on, you'll have to read ["The Operational Monad Tutorial"][tutorial]. Here, I will first and foremost note the changes with respect to the tutorial.
-
-Several advanced [example monads](./examples.html) demonstrate how to put this library to good use. In the source distribution, the corresponding source files can also be found in the `.docs/examples` folder.
-
-Changes to the `Program` type
------------------------------
-For efficiency reasons, the type `Program` representing a list of instructions is now *abstract*. A function `view` is used to inspect the first instruction, it returns a type
-
-    data ProgramView instr a where
-        Return :: a -> ProgramView instr a
-        (:>>=) :: instr a -> (a -> Program instr b) -> ProgramView instr b
-
-which is much like the old `Program` type, except that `Then` was renamed to `:>>=` and that the subsequent instructions stored in the second argument of `:>>=` are stored in the type `Program`, not `ProgramView`.
- 
-To see an example of the new style, here the interpreter for the stack machine from the tutorial:
-
-    interpret :: StackProgram a -> (Stack Int -> a)
-    interpret = eval . view
-        where
-        eval :: ProgramView StackInstruction a -> (Stack Int -> a)
-        eval (Push a :>>= is) stack     = interpret (is ()) (a:stack)
-        eval (Pop    :>>= is) (a:stack) = interpret (is a ) stack
-        eval (Return a)       stack     = a
-
-So-called "view functions" like `view` are a common way of inspecting data structures that have been made abstract for reasons of efficiency; see for example `viewL` and `viewR` in [`Data.Sequence`][containers].
-
-  [containers]: http://hackage.haskell.org/package/containers-0.3.0.0
-
-Efficiency
-----------
-Compared to the original type from the tutorial, `Program` now supports `>>=` in O(1) time in most use cases. This means that left-biased nesting like
-
-    let
-        nestLeft :: Int -> StackProgram Int
-        nestLeft 0 = return 0
-        nestLeft n = nestLeft (n-1) >>= push
-    in
-        interpret (nestLeft n) []
-       
-will now take O(n) time. In contrast, the old `Program` type from the tutorial would have taken O(n^2) time, similar to `++` for lists taking quadratic time in when nested to the left.
-
-However, this does *not* hold in a *persistent* setting. In particular, the example
-
-    let
-        p  = nestLeft n
-        v1 = view p
-        v2 = view p
-        v3 = view p
-    in
-        v1 `seq` v2 `seq` v3
-
-will take O(n) time for each call of `view` instead of O(n) the first time and O(1) for the other calls. But since monads are usually used ephemerally, this is much less a restriction than it would be for lists and `++`.
-
-Monad Transformers
-------------------
-Furthermore, `Program` is actually a type synonym and expressed in terms of a monad transformer `ProgramT`
-
-    type Program instr a = ProgramT instr Identity a
-
-Likewise, `view` is a specialization of `viewT` to the identity monad. This change is transparent (except for error messages on type errors) for users who are happy with just `Program` but very convenient for those users who want to use it as a monad transformer.
-
-The key point about the transformer version `ProgramT` is that in addition to the monad laws, it automatically satisfies the lifting laws for monad transformers as well
-
-    lift . return        =  return
-    lift m >>= lift . g  =  lift (m >>= g)
-
-The corresponding view function `viewT` now returns the type `m (ViewT instr m a)`. It's not immediately apparent why this return type will do, but it's straightforward to work with, like in the following implementation of the list monad transformer:
-
-    data PlusI m a where
-        Zero :: PlusI m a
-        Plus :: ListT m a -> ListT m a -> PlusI m a
-    
-    type ListT m a = ProgramT (PlusI m) m a
-    
-    runList :: Monad m => ListT m a -> m [a]
-    runList = eval <=< viewT
-        where
-        eval :: Monad m => ProgramViewT (PlusI m) m a -> m [a]
-        eval (Return x)        = return [x]
-        eval (Zero     :>>= k) = return []
-        eval (Plus m n :>>= k) =
-            liftM2 (++) (runList (m >>= k)) (runList (n >>= k))
-
-
-Alternatives to Monad Transformers
-----------------------------------
-By the way, note that monad transformers are not the only way to build larger monads from smaller ones; a similar effect can be achieved with the direct sum of instructions sets. For instance, the monad
-
-    Program (StateI s :+: ExceptionI e) a
-
-    data (f :+: g) a = Inl (f a) | Inr (g a)  -- a fancy  Either
-
-is a combination of the state monad
-
-    type State a = Program (StateI s) a
-
-    data StateI s a where
-        Put :: s -> StateI s ()
-        Get :: StateI s s
-
-and the error monad
-
-    type Error e a = Program (ErrorI e) a
-
-    data ErrorI e a where
-        Throw :: e -> ErrorI e ()
-        Catch :: ErrorI e a -> (e -> ErrorI e a) -> ErrorI e a
-
-The "sum of signatures" approach and the `(:+:)` type constructor are advocated in [Wouter Swierstra's "Data Types a la carte"][a la carte]. Time will tell which has more merit; for now I have opted for a seamless interaction with monad transformers.
-
-  [a la carte]: http://www.cse.chalmers.se/~wouter/Publications/DataTypesALaCarte.pdf "Wouter Swierstra. Data types  la carte."
-
-
-Design and Implementation
-=========================
-Proof of the monad laws (Sketch)
---------------------------------
-The key point of this library is of course that the `view` and `viewT` functions respect the monad laws. While this seems obvious from the definition, the proof is actually not straightforward.
-
-First, we restrict ourselves to `view`, i.e. the version without monad transformers. In fact, I don't have a full proof for the version with monad transformers, more about that in the next section.
-
-Second, we use a sloppy, but much more suitable notation, namely we write
-
----------    -------------------------
-`>>=`         instead of `Bind`
-`return`      instead of `Lift` for the identity monad
-`i,j,k,`...   for primitive instructions
--------------------------------------------------------------
-
-Then, the `view` function becomes
-
-    view (return a)        = Return a
-    view (return a  >>= g) = g a                           -- left unit
-    view ((m >>= f) >>= g) = view (m >>= (\x -> f x >>= g) -- associativity
-    view (i         >>= g) = i :>>= g
-    view  i                = i :>>= return                 -- right unit
-
-Clearly, `view` uses the monad laws to rewrite it's argument. But we want to show that whenever two expressions
-
-    e1,e2 :: Program instr a
-
-can be transformed into each other by rewriting them with the monad laws in *any* fashion (remember that `>>=` and `return` are constructors), then `view` will map them to the same result. More formally, we have an equivalence relation
-
-    e1 ~ e2   iff   e1 and e2 are the same modulo monad laws
-
-and want to show
-
-    e1 ~ e2  =>   view e1 = view e2    (some notion of equality)
-
-Now, this needs proof because `view` is like a term rewriting system and there is no guarantee that two equivalent terms will be rewritten to the same normal form.
-
-Trying to attack this problem with term rewriting and critical pairs is probably hopeless and not very enlightening. After all, the theorem should be obvious because two equivalent expressions should have the same *first instruction* `i`. Well, we can formalize this with the help of a *normal form*
-
-    data NF instr a where
-        Return' :: a -> NF instr a
-        (:>>=') :: instr a -> (a -> NF instr b) -> NF instr b
-
-This is the old program type and the key observation is that `NF instr` is already a monad.
-
-    instance Monad (NF inst) where
-        (Return' a) >>= g = g a
-        (m :>>=' f) >>= g = m :>>= (\x -> f x >>= g)
-
-(I'll skip the short calculation and coinduction argument that this really fulfills the monad laws.) We can define a normalization function
-
-    normalize :: Program instr a -> NF instr a
-    normalize (m >>= g)  = normalize m >>=' normalize g
-    normalize (return a) = Return' a
-    normalize  i         = i :>>=' Return'
-
-which has the now obvious property that
-
-    e1 ~ e2  =>  normalize e1 = normalize e2
-
-Now, the return type of `view` is akin to a *head normal form*, hence
-
-       normalize (view e1) = normalize (view e2) 
-    => view e1 = view e2
-
-(for some suitable extension of `normalize` to the `ProgramView` type.) But since `view` only uses monad laws to rewrite its argument, we also have
-
-    e1 ~ view e1  =>  normalize e1 = normalize (view e1)
-
-and this concludes the proof, which pretty much only showed that two equivalent expressions have the same instruction list and hence `view` gives equal results.
-
-Monad Transformers
-------------------
-The monad transformer case is more hairy, I have no proof here. (If you read this by accident: don't worry, it's still correct. This is for proof nerds only.)
-
-The main difficulty is that the equation
-
-    return = lift . return
-
-is an equation for the already existing `return` constructor and the notion of "first instruction" no longer applies. Namely, we have
-
-    m  =  return m >>= id  =  lift (return m) >>= id
-
-and it's not longer clear what a suitable normal form might be. It appears that `viewT` rewrites the term as follows
-
-      lift m >>= g
-    = lift m >>= (\x -> lift (return (g x)) >>= id)
-    = (lift m >>= lift . return . g) >>= id
-    = lift (m >>= return . g) >>= id
-
-(To be continued.)
-
-
-Other Design Choices
-====================
-Recursive type definitions with `Program`
------------------------------------------
-In the [unimo paper][unimo], the instructions carry an additional parameter that "unties" recursive type definition. For example, the instructions for `MonadPlus` are written
-
-    data PlusI unimo a where
-        Zero :: PlusI unimo a
-        Plus :: unimo a -> unimo a -> PlusI unimo a
-
-The type constructor variable `unimo` will be tied to `Unimo PlusI`.
-
-In this library, I have opted for the conceptually simpler approach that requires the user to tie the recursion himself
-
-    data PlusI a where
-        Zero :: PlusI a
-        Plus :: Program PlusI a -> Program PlusI a -> Plus I a
-
-I am not sure whether this has major consequences for composeablity; at the moment I believe that the former style can always be recovered from an implementation in the latter style.
-
diff --git a/docs/Makefile b/docs/Makefile
deleted file mode 100644
--- a/docs/Makefile
+++ /dev/null
@@ -1,38 +0,0 @@
-######################################################################
-### Documentation and examples
-.PHONY: website doc
-
-examples_hs=ListT LogicT PoorMansConcurrency TicTacToe State
-examples_lhs=WebSessionState
-examples=$(examples_hs:%=%.hs) $(examples_lhs:%=%.lhs)
-
-documentation=Documentation.html $(examples:%=examples/%.html) examples/operational-examples.tar.gz
-
-static=index.html examples.html fptools.css
-
-doc: $(documentation:%=web/%)
-
-HOST=apfelmus@code.haskell.org:/srv/projects/operational
-website: $(documentation:%=web/%) $(static:%=web/%)
-	rsync $(static:%=web/%) web/Documentation.html $(HOST)
-	rsync $(examples:%=web/examples/%.html) web/examples/hscolour.css \
-		$(HOST)/examples
-
-######################################################################
-### Generating documentation
-
-web/Documentation.html : Documentation.md 
-	pandoc --standalone --toc --css=fptools.css \
-		--number-sections "$<" > "$@"
-
-clean:
-	rm Documentation.html
-
-web/%.hs.html: %.hs
-	HsColour "$<" -css -o"$@"
-web/%.lhs.html: %.lhs
-	HsColour "$<" -css -o"$@"
-
-web/examples/operational-examples.tar.gz: $(examples:%=examples/%)
-	tar czvf "$@" $^
-
diff --git a/docs/examples/ListT.hs b/docs/examples/ListT.hs
deleted file mode 100644
--- a/docs/examples/ListT.hs
+++ /dev/null
@@ -1,56 +0,0 @@
-{------------------------------------------------------------------------------
-    Control.Monad.Operational
-    
-    Example:
-    List Monad Transformer
-
-------------------------------------------------------------------------------}
-{-# LANGUAGE GADTs, Rank2Types, FlexibleInstances #-}
-module ListT where
-
-import Control.Monad
-import Control.Monad.Operational
-import Control.Monad.Trans
-
-{------------------------------------------------------------------------------
-    A direct implementation
-        type ListT m a = m [a]
-    would violate the monad laws, but we don't have that problem.
-------------------------------------------------------------------------------}
-data MPlus m a where
-    MZero :: MPlus m a
-    MPlus :: ListT m a -> ListT m a -> MPlus m a
-
-type ListT m a = ProgramT (MPlus m) m a
-
-    -- *sigh* I want to use type synonyms for type constructors, too;
-    -- GHC doesn't accept  MonadMPlus (ListT m)
-instance Monad m => MonadPlus (ProgramT (MPlus m) m) where
-    mzero     = singleton MZero
-    mplus m n = singleton (MPlus m n)
-
-runListT :: Monad m => ListT m a -> m [a]
-runListT = eval <=< viewT
-    where
-    eval :: Monad m => ProgramViewT (MPlus m) m a -> m [a]
-    eval (Return x)         = return [x]
-    eval (MZero     :>>= k) = return []
-    eval (MPlus m n :>>= k) =
-        liftM2 (++) (runListT (m >>= k)) (runListT (n >>= k))
-
-testListT :: IO [()]
-testListT = runListT $ do
-    n <- choice [1..5]
-    lift . print $ "You've chosen the number: " ++ show n
-    where
-    choice = foldr1 mplus . map return
-
-
-    -- testing the monad laws, from the Haskellwiki
-    -- http://www.haskell.org/haskellwiki/ListT_done_right#Order_of_printing
-a,b,c :: ListT IO ()
-[a,b,c] = map (lift . putChar) ['a','b','c']
-
-    -- t1 and t2 have to print the same sequence of letters
-t1 = runListT $ ((a `mplus` a) >> b) >> c
-t2 = runListT $ (a `mplus` a) >> (b >> c)
diff --git a/docs/examples/LogicT.hs b/docs/examples/LogicT.hs
deleted file mode 100644
--- a/docs/examples/LogicT.hs
+++ /dev/null
@@ -1,86 +0,0 @@
-{------------------------------------------------------------------------------
-    Control.Monad.Operational
-    
-    Example:
-    Oleg's  LogicT  monad transformer
-    
-    Functions to implement are taken from the corresponding paper
-    http://okmij.org/ftp/papers/LogicT.pdf
-    
-------------------------------------------------------------------------------}
-{-# LANGUAGE GADTs, Rank2Types #-}
-module LogicT (LogicT, msplit, observe, bagOfN, interleave) where
-
-import Control.Monad
-import Control.Monad.Operational
-import Control.Monad.Trans
-
-import Data.Maybe
-
-{------------------------------------------------------------------------------
-    LogicT
-    = A MonadPlus with an additional operation
-         msplit
-      which returns the first result and a computation to 
-      produce the remaining results.
-
-
-    For example, the function  msplit  satisfies the laws
-    
-        msplit mzero                 ~> return Nothing
-        msplit (return a `mplus` m)  ~> return (Just (a,m))
-    
-    It turns out that we don't have to make  msplit  a primitive,
-    we can implement it by inspection on the argument. In other
-    words,  LogicT  will be the same as the  ListT  monad transformer
-------------------------------------------------------------------------------}
-import ListT
-type LogicT m a = ListT m a
-
-    -- msplit  is the lift of a function  split  in the base monad
-msplit :: Monad m => LogicT m a -> LogicT m (Maybe (a, LogicT m a))
-msplit = lift . split
-
-    -- split  in the base monad
-split :: Monad m => LogicT m a -> m (Maybe (a, LogicT m a))
-split = eval <=< viewT
-    where
-    -- apply the laws for  msplit
-    eval :: Monad m => ProgramViewT (MPlus m) m a -> m (Maybe (a, LogicT m a))
-    eval (MZero     :>>= k) = return Nothing
-    eval (MPlus m n :>>= k) = do
-        ma <- split (m >>= k)
-        case ma of
-            Nothing     -> split (n >>= k)
-            Just (a,m') -> return $ Just (a, m' `mplus` (n >>= k))
-                                --            inefficient!
-                                -- `mplus` will add another (>>= return)
-                                -- to  n  each time it's called.
-                                -- Curing this is not easy.
-
-    -- main interpreter, section 6 in the paper
-    -- returns the first result, if any; may fail
-observe :: Monad m => LogicT m a -> m a
-observe m = (fst . fromJust) `liftM` split m
-
-{------------------------------------------------------------------------------
-    Derived functions from the paper
-------------------------------------------------------------------------------}
-    -- return the first n results, section 6
-bagOfN :: Monad m => Maybe Int -> LogicT m a -> LogicT m [a]
-bagOfN (Just n) m | n <= 0 = return []
-bagOfN n m                 = msplit m >>= bagofN'
-    where
-    bagofN' Nothing         = return []
-    bagofN' (Just (x,m'))   = (x:) `liftM` bagOfN (fmap pred  n) m'
-                            where pred n = n-1
-
-    -- interleave
-interleave :: Monad m => LogicT m a -> LogicT m a -> LogicT m a
-interleave m1 m2 = do
-    r <- msplit m1
-    case r of
-        Nothing      -> m2
-        Just (a,m1') -> return a `mplus` interleave m2 m1'
-
-
diff --git a/docs/examples/PoorMansConcurrency.hs b/docs/examples/PoorMansConcurrency.hs
deleted file mode 100644
--- a/docs/examples/PoorMansConcurrency.hs
+++ /dev/null
@@ -1,63 +0,0 @@
-{------------------------------------------------------------------------------
-    Control.Monad.Operational
-    
-    Example:
-    Koen Claessen's Poor Man's Concurrency Monad
-    http://www.cs.chalmers.se/~koen/pubs/entry-jfp99-monad.html
-
-------------------------------------------------------------------------------}
-{-# LANGUAGE GADTs, Rank2Types #-}
-module PoorMansConcurrency where
-
-import Control.Monad
-import Control.Monad.Operational
-import Control.Monad.Trans hiding (lift)
-
-{------------------------------------------------------------------------------
-    A concurrency monad runs several processes in parallel
-    and supports two operations
-
-        fork  -- fork a new process
-        stop  -- halt the current one
-    
-    We want this to be a monad transformer, so we also need a function  lift
-    This time, however, we cannot use the monad transformer version  ProgramT
-    because this will leave no room for interleaving different computations
-    of the base monad.
-------------------------------------------------------------------------------}
-data ProcessI m a where
-    Lift :: m a -> ProcessI m a
-    Stop :: ProcessI m a
-    Fork :: Process m () -> ProcessI m ()
-
-
-type Process m a = Program (ProcessI m) a
-
-stop = singleton Stop
-fork = singleton . Fork
-lift = singleton . Lift
-
-    -- interpreter
-runProcess :: Monad m => Process m a -> m ()
-runProcess m = schedule [m]
-    where
-    schedule (x:xs) = run (view x) xs
-
-    run :: Monad m => ProgramView (ProcessI m) a -> [Process m a] -> m ()
-    run (Return _)      xs = return ()                 -- process finished
-    run (Lift m :>>= k) xs = m >>= \a ->               -- switch process
-                             schedule (xs ++ [k a])
-    run (Stop   :>>= k) xs = schedule xs               -- process halts
-    run (Fork p :>>= k) xs = schedule (xs ++ [x2,x1])  -- fork new process
-        where x1 = k (); x2 = p >>= k
-
-    -- example
-    --      > runProcess example   -- warning: runs indefinitely
-example :: Process IO ()
-example = do
-        write "Start!"
-        fork (loop "fish")
-        loop "cat"
-
-write  = lift . putStr
-loop s = write s >> loop s
diff --git a/docs/examples/State.hs b/docs/examples/State.hs
deleted file mode 100644
--- a/docs/examples/State.hs
+++ /dev/null
@@ -1,60 +0,0 @@
-{------------------------------------------------------------------------------
-    Control.Monad.Operational
-    
-    Example:
-    State monad and monad transformer
-    
-------------------------------------------------------------------------------}
-{-# LANGUAGE GADTs, Rank2Types, FlexibleInstances #-}
-module State where
-
-import Control.Monad
-import Control.Monad.Operational
-import Control.Monad.Trans
-
-{------------------------------------------------------------------------------
-	State Monad
-------------------------------------------------------------------------------}
-data StateI s a where
-    Get :: StateI s s
-    Put :: s -> StateI s ()
-
-type State s a = Program (StateI s) a
-
-evalState :: State s a -> s -> a
-evalState = eval . view
-    where
-    eval :: ProgramView (StateI s) a -> (s -> a)
-    eval (Return x)     = const x
-    eval (Get   :>>= k) = \s -> evalState (k s ) s
-    eval (Put s :>>= k) = \_ -> evalState (k ()) s
-
-put :: s -> StateT s m ()
-put = singleton . Put
-
-get :: StateT s m s
-get = singleton Get
-
-testState :: Int -> Int
-testState = evalState $ do
-        x <- get
-        put (x+2)
-        get
-
-{------------------------------------------------------------------------------
-    State Monad Transformer
-------------------------------------------------------------------------------}
-type StateT s m a = ProgramT (StateI s) m a
-
-evalStateT :: Monad m => StateT s m a -> s -> m a
-evalStateT m = \s -> viewT m >>= \p -> eval p s
-    where
-    eval :: Monad m => ProgramViewT (StateI s) m a -> (s -> m a)
-    eval (Return x)     = \_ -> return x
-    eval (Get   :>>= k) = \s -> evalStateT (k s ) s
-    eval (Put s :>>= k) = \_ -> evalStateT (k ()) s
-
-testStateT = evalStateT $ do
-    x <- get
-    lift $ putStrLn "Hello StateT"
-    put (x+1)
diff --git a/docs/examples/TicTacToe.hs b/docs/examples/TicTacToe.hs
deleted file mode 100644
--- a/docs/examples/TicTacToe.hs
+++ /dev/null
@@ -1,175 +0,0 @@
-{------------------------------------------------------------------------------
-    Control.Monad.Operational
-    
-    Example:
-    An implementation of the game TicTacToe.
-    
-    Each player (human, AI, ...) is implemented in a separate monad
-    which are then intermingled to run the game. This resembles the
-    PoorMansConcurrency.hs example.
-    
-    
-    Many thanks to Yves Par`es and Bertram Felgenhauer
-    http://www.haskell.org/pipermail/haskell-cafe/2010-April/076216.html
-
-------------------------------------------------------------------------------}
-{-# LANGUAGE GADTs, Rank2Types #-}
-
-import Control.Monad
-import Control.Monad.Operational
-import Control.Monad.State
-
-import Data.Either
-import Data.List
-
-    -- external libraries needed
-import System.Random
-
-{------------------------------------------------------------------------------
-    The Player monad for implementing players (human, AI, ...)
-    provides two operations
-    
-        readBoard   -- read the current board position
-        playMove    -- play a move
-
-    to query the current board position and perform a move, respectively.
-    
-    Moreover, it's actually a monad transformer intended to be used over IO.
-    This way, the players can perform IO computations.
-------------------------------------------------------------------------------}
-data PlayerI a where
-    ReadBoard :: PlayerI Board
-    PlayMove  :: Int -> PlayerI Bool
-    
-type Player m a = ProgramT PlayerI m a
-
-readBoard = singleton ReadBoard
-playMove  = singleton . PlayMove
-
-    -- interpreter
-runGame :: Player IO () -> Player IO () -> IO ()
-runGame player1 player2 = eval' initialGameState player1 player2
-    where
-    eval' game p1 p2 = viewT p1 >>= \p1view -> eval game p1view p2
-    
-    eval :: GameState
-         -> ProgramViewT PlayerI IO () -> Player IO ()
-         -> IO ()
-    eval game (Return _)            _  = return ()
-    eval game (ReadBoard   :>>= p1) p2 = eval' game (p1 (board game)) p2
-    eval game (PlayMove mv :>>= p1) p2 =
-        case makeMove mv game of
-            Nothing         -> eval' game (p1 False) p2
-            Just game'
-                | won game' -> let p = activePlayer game in
-                               putStrLn $ "Player " ++ show p ++ " has won!"
-                | draw game'-> putStrLn $ "It's a draw."
-                | otherwise -> eval' game' p2 (p1 True)
-    
-    -- example: human vs AI
-main = do
-    g <- getStdGen
-    runGame playerHuman (playerAI g)
-
-{------------------------------------------------------------------------------
-    TicTacToe Board type and logic
-    
-    The board looks like this:
-    
-    +---+---+---+   some squares already played on
-    | 1 | 2 | 3 |   the empty squares are numbered
-    +---+---+---+
-    | 4 | 5 |OOO|
-    +---+---+---+
-    | 7 |XXX| 9 |
-    +---+---+---+
-------------------------------------------------------------------------------}
-data Symbol = X | O deriving (Eq,Show)
-type Square = Either Int Symbol
-type Board = [[Square]]
-data GameState = Game { board :: Board, activePlayer :: Symbol }
-
-initialGameState :: GameState
-initialGameState = Game (map (map Left) [[1,2,3],[4,5,6],[7,8,9]]) X
-
-    -- list the possible moves to play
-possibleMoves :: Board -> [Int]
-possibleMoves board = [k | Left k <- concat board]
-
-    -- play a stone at a square
-makeMove :: Int -> GameState -> Maybe GameState
-makeMove k (Game board player)
-    | not (k `elem` possibleMoves board) = Nothing   -- illegal move
-    | otherwise = Just $ Game (map (map replace) board) (switch player)
-    where
-    replace (Left k') | k' == k = Right player
-    replace x                   = x
-
-    switch X = O
-    switch O = X
-
-    -- has somebody won the game?
-won :: GameState -> Bool
-won (Game board _) = any full $ diagonals board ++ rows board ++ cols board
-    where
-    full [a,b,c] = a == b && b == c
-    diagonals [[a1,_,b1],
-               [_ ,c,_ ],
-               [b2,_,a2]] = [[a1,c,a2],[b1,c,b2]]
-    rows = id
-    cols = transpose
-
-    -- is the game a draw?
-draw :: GameState -> Bool
-draw (Game board _) = null (possibleMoves board)
-
-    -- print the board
-showSquare = either (\n -> " " ++ show n ++ " ") (concat . replicate 3 . show)
-
-showBoard :: Board -> String
-showBoard board =
-      unlines . surround "+---+---+---+"
-    . map (concat . surround "|". map showSquare)
-    $ board
-    where
-    surround x xs = [x] ++ intersperse x xs ++ [x]
-
-printBoard = putStr . showBoard
-
-{------------------------------------------------------------------------------
-    Player examples
-------------------------------------------------------------------------------}
-    -- a human player on the command line
-playerHuman :: Player IO ()
-playerHuman = forever $ readBoard >>= liftIO . printBoard >> doMove
-    where
-    -- ask the player where to move
-    doMove :: Player IO ()
-    doMove = do
-        liftIO . putStrLn $ "At which number would you like to play?"
-        n <- liftIO getLine
-        b <- playMove (read n)
-        unless b $ do
-            liftIO . putStrLn $ "Position " ++ show n ++ " is already full."
-            doMove
-
-    -- a random AI,
-    -- also demonstrates how to use a custom StateT on top
-    --   of the Player monad
-playerAI :: Monad m => StdGen -> Player m ()
-playerAI = evalStateT ai
-    where
-    ai :: Monad m => StateT StdGen (ProgramT PlayerI m) ()
-    ai = forever $ do
-        board <- lift $ readBoard
-        n     <- uniform (possibleMoves board) -- select a random move
-        lift $ playMove n
-        where
-        -- select one element at random
-        uniform :: Monad m => [a] -> StateT StdGen m a
-        uniform xs = do
-            gen <- get
-            let (n,gen') = randomR (1,length xs) gen
-            put gen'
-            return (xs !! (n-1))
-
diff --git a/docs/examples/WebSessionState.lhs b/docs/examples/WebSessionState.lhs
deleted file mode 100644
--- a/docs/examples/WebSessionState.lhs
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/bin/sh runghc
-\begin{code}
-{------------------------------------------------------------------------------
-    Control.Monad.Operational
-    
-    Example:
-    A CGI script that maintains session state
-    http://www.informatik.uni-freiburg.de/~thiemann/WASH/draft.pdf
-
-------------------------------------------------------------------------------}
-{-# LANGUAGE GADTs, Rank2Types #-}
-module WebSessionState where
-
-import Control.Monad
-import Control.Monad.Operational
-import Control.Monad.Trans hiding (lift)
-
-import Data.Char
-import Data.Maybe
-
-    -- external libraries needed
-import Text.Html as H
-import Network.CGI
-
-{------------------------------------------------------------------------------
-    This example shows a "magic" implementation of a web session that
-    looks like it needs to be executed in a running process,
-    while in fact it's just a CGI script.
-    
-    The key part is a monad, called "Web" for lack of imagination,
-    which supports a single operation
-    
-        ask :: String -> Web String
-    
-    which sends a simple minded HTML-Form to the web user
-    and returns his answer.
-    
-    How does this work? The trick is that all previous answers
-    are logged in a hidden field of the input form.
-    The CGI script will simply replays this log when called.
-    In other words, the user state is stored in the input form.
-
-------------------------------------------------------------------------------}
-data WebI a where
-    Ask :: String -> WebI String
-
-type Web a = Program WebI a
-
-ask = singleton . Ask
-
-    -- interpreter
-runWeb :: Web H.Html -> CGI CGIResult
-runWeb m = do
-            -- fetch log
-        log' <- maybe [] (read . urlDecode) `liftM` getInput "log"
-            -- maybe append form input
-        f    <- maybe id (\answer -> (++ [answer])) `liftM` getInput "answer"
-        let log = f log'
-            -- run Web action and output result
-        output . renderHtml =<< replay m log log
-    where
-    replay = eval . view
-    
-    eval :: ProgramView WebI H.Html -> [String] -> [String] -> CGI H.Html
-    eval (Return html)         log _      = return html
-    eval (Ask question :>>= k) log (l:ls) = -- replay answer from log
-        replay (k l) log ls
-    eval (Ask question :>>= k) log []     = -- present HTML page to user
-        return $ htmlQuestion log question
-
-
-    -- HTML page with a single form
-htmlQuestion log question = htmlEnvelope $ p << question +++ x
-    where
-    x = form ! [method "post"] << (textfield "answer"
-                +++ submit "Next" ""
-                +++ hidden "log" (urlEncode $ show log))
-
-htmlMessage s = htmlEnvelope $ p << s
-
-htmlEnvelope html =
-    header << thetitle << "Web Session State demo"
-    +++ body << html
-
-
-    -- example
-example :: Web H.Html
-example = do
-    haskell <- ask "What's your favorite programming language?"
-    if map toLower haskell /= "haskell"
-        then message "Awww."
-        else do
-            ghc <- ask "What's your favorite compiler?"
-            web <- ask "What's your favorite monad?"
-            message $ "I like " ++ ghc ++ " too, but "
-                      ++ web ++ " is debatable."
-    where
-    message = return . htmlMessage
-
-main = runCGI . runWeb $ example
-
-\end{code}
diff --git a/docs/web/Documentation.html b/docs/web/Documentation.html
deleted file mode 100644
--- a/docs/web/Documentation.html
+++ /dev/null
@@ -1,635 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-  <title>Documentation for the &quot;operational&quot; package</title>
-  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-  <meta name="generator" content="pandoc" />
-  <meta name="author" content="Heinrich Apfelmus" />
-  <meta name="date" content="Sun, 18 Apr 2010 13:06:16 +0200" />
-  <link rel="stylesheet" href="fptools.css" type="text/css" />
-</head>
-<body>
-<h1 class="title">Documentation for the &quot;operational&quot; package</h1>
-<div id="TOC"
-><ul
-  ><li
-    ><a href="#introduction"
-      ><span class="toc-section-number"
-	>1</span
-	> Introduction</a
-      ></li
-    ><li
-    ><a href="#using-this-library"
-      ><span class="toc-section-number"
-	>2</span
-	> Using this Library</a
-      ><ul
-      ><li
-	><a href="#changes-to-the-Program-type"
-	  ><span class="toc-section-number"
-	    >2.1</span
-	    > Changes to the <code
-	    >Program</code
-	    > type</a
-	  ></li
-	><li
-	><a href="#efficiency"
-	  ><span class="toc-section-number"
-	    >2.2</span
-	    > Efficiency</a
-	  ></li
-	><li
-	><a href="#monad-transformers"
-	  ><span class="toc-section-number"
-	    >2.3</span
-	    > Monad Transformers</a
-	  ></li
-	><li
-	><a href="#alternatives-to-monad-transformers"
-	  ><span class="toc-section-number"
-	    >2.4</span
-	    > Alternatives to Monad Transformers</a
-	  ></li
-	></ul
-      ></li
-    ><li
-    ><a href="#design-and-implementation"
-      ><span class="toc-section-number"
-	>3</span
-	> Design and Implementation</a
-      ><ul
-      ><li
-	><a href="#proof-of-the-monad-laws-sketch"
-	  ><span class="toc-section-number"
-	    >3.1</span
-	    > Proof of the monad laws (Sketch)</a
-	  ></li
-	><li
-	><a href="#monad-transformers-1"
-	  ><span class="toc-section-number"
-	    >3.2</span
-	    > Monad Transformers</a
-	  ></li
-	></ul
-      ></li
-    ><li
-    ><a href="#other-design-choices"
-      ><span class="toc-section-number"
-	>4</span
-	> Other Design Choices</a
-      ><ul
-      ><li
-	><a href="#recursive-type-definitions-with-Program"
-	  ><span class="toc-section-number"
-	    >4.1</span
-	    > Recursive type definitions with <code
-	    >Program</code
-	    ></a
-	  ></li
-	></ul
-      ></li
-    ></ul
-  ></div
->
-<!-- *The HTML version of this document is generated automatically from the corresponding markdown file, don't change it!* -->
-<div id="introduction"
-><h1
-  ><a href="#TOC"
-    ><span class="header-section-number"
-      >1</span
-      > Introduction</a
-    ></h1
-  ><p
-  >This package is based on <a href="http://themonadreader.wordpress.com/2010/01/26/issue-15/"
-    >&quot;The Operational Monad Tutorial&quot;</a
-    > and this documentation describes its extension to a production-quality library. In other words, the &quot;magic&quot; gap between relevant paper and library implementation is documented here.</p
-  ><p
-  >Take note that this this library is only ~50 lines of code, yet the documentation even includes a proof! :-)</p
-  ><p
-  >Sources and inspiration for this library include <a href="http://web.cecs.pdx.edu/~cklin/papers/unimo-143.pdf" title="Chuan-kai Lin. Programming Monads Operationally with Unimo."
-    >Chuan-kai Lin's unimo paper</a
-    >, <a href="http://citeseer.ist.psu.edu/hughes95design.html" title="John Hughes. The Design of a Pretty-printing Library."
-    >John Hughes 95</a
-    >, and <a href="http://hackage.haskell.org/package/MonadPrompt" title="Ryan Ingram's Monad Prompt Package."
-    >Ryan Ingram's <code
-      >MonadPrompt</code
-      > package</a
-    >.</p
-  ></div
-><div id="using-this-library"
-><h1
-  ><a href="#TOC"
-    ><span class="header-section-number"
-      >2</span
-      > Using this Library</a
-    ></h1
-  ><p
-  >To understand what's going on, you'll have to read <a href="http://themonadreader.wordpress.com/2010/01/26/issue-15/"
-    >&quot;The Operational Monad Tutorial&quot;</a
-    >. Here, I will first and foremost note the changes with respect to the tutorial.</p
-  ><p
-  >Several advanced <a href="./examples.html"
-    >example monads</a
-    > demonstrate how to put this library to good use. In the source distribution, the corresponding source files can also be found in the <code
-    >.docs/examples</code
-    > folder.</p
-  ><div id="changes-to-the-Program-type"
-  ><h2
-    ><a href="#TOC"
-      ><span class="header-section-number"
-	>2.1</span
-	> Changes to the <code
-	>Program</code
-	> type</a
-      ></h2
-    ><p
-    >For efficiency reasons, the type <code
-      >Program</code
-      > representing a list of instructions is now <em
-      >abstract</em
-      >. A function <code
-      >view</code
-      > is used to inspect the first instruction, it returns a type</p
-    ><pre
-    ><code
-      >data ProgramView instr a where
-    Return :: a -&gt; ProgramView instr a
-    (:&gt;&gt;=) :: instr a -&gt; (a -&gt; Program instr b) -&gt; ProgramView instr b
-</code
-      ></pre
-    ><p
-    >which is much like the old <code
-      >Program</code
-      > type, except that <code
-      >Then</code
-      > was renamed to <code
-      >:&gt;&gt;=</code
-      > and that the subsequent instructions stored in the second argument of <code
-      >:&gt;&gt;=</code
-      > are stored in the type <code
-      >Program</code
-      >, not <code
-      >ProgramView</code
-      >.</p
-    ><p
-    >To see an example of the new style, here the interpreter for the stack machine from the tutorial:</p
-    ><pre
-    ><code
-      >interpret :: StackProgram a -&gt; (Stack Int -&gt; a)
-interpret = eval . view
-    where
-    eval :: ProgramView StackInstruction a -&gt; (Stack Int -&gt; a)
-    eval (Push a :&gt;&gt;= is) stack     = interpret (is ()) (a:stack)
-    eval (Pop    :&gt;&gt;= is) (a:stack) = interpret (is a ) stack
-    eval (Return a)       stack     = a
-</code
-      ></pre
-    ><p
-    >So-called &quot;view functions&quot; like <code
-      >view</code
-      > are a common way of inspecting data structures that have been made abstract for reasons of efficiency; see for example <code
-      >viewL</code
-      > and <code
-      >viewR</code
-      > in <a href="http://hackage.haskell.org/package/containers-0.3.0.0"
-      ><code
-	>Data.Sequence</code
-	></a
-      >.</p
-    ></div
-  ><div id="efficiency"
-  ><h2
-    ><a href="#TOC"
-      ><span class="header-section-number"
-	>2.2</span
-	> Efficiency</a
-      ></h2
-    ><p
-    >Compared to the original type from the tutorial, <code
-      >Program</code
-      > now supports <code
-      >&gt;&gt;=</code
-      > in O(1) time in most use cases. This means that left-biased nesting like</p
-    ><pre
-    ><code
-      >let
-    nestLeft :: Int -&gt; StackProgram Int
-    nestLeft 0 = return 0
-    nestLeft n = nestLeft (n-1) &gt;&gt;= push
-in
-    interpret (nestLeft n) []
-</code
-      ></pre
-    ><p
-    >will now take O(n) time. In contrast, the old <code
-      >Program</code
-      > type from the tutorial would have taken O(n^2) time, similar to <code
-      >++</code
-      > for lists taking quadratic time in when nested to the left.</p
-    ><p
-    >However, this does <em
-      >not</em
-      > hold in a <em
-      >persistent</em
-      > setting. In particular, the example</p
-    ><pre
-    ><code
-      >let
-    p  = nestLeft n
-    v1 = view p
-    v2 = view p
-    v3 = view p
-in
-    v1 `seq` v2 `seq` v3
-</code
-      ></pre
-    ><p
-    >will take O(n) time for each call of <code
-      >view</code
-      > instead of O(n) the first time and O(1) for the other calls. But since monads are usually used ephemerally, this is much less a restriction than it would be for lists and <code
-      >++</code
-      >.</p
-    ></div
-  ><div id="monad-transformers"
-  ><h2
-    ><a href="#TOC"
-      ><span class="header-section-number"
-	>2.3</span
-	> Monad Transformers</a
-      ></h2
-    ><p
-    >Furthermore, <code
-      >Program</code
-      > is actually a type synonym and expressed in terms of a monad transformer <code
-      >ProgramT</code
-      ></p
-    ><pre
-    ><code
-      >type Program instr a = ProgramT instr Identity a
-</code
-      ></pre
-    ><p
-    >Likewise, <code
-      >view</code
-      > is a specialization of <code
-      >viewT</code
-      > to the identity monad. This change is transparent (except for error messages on type errors) for users who are happy with just <code
-      >Program</code
-      > but very convenient for those users who want to use it as a monad transformer.</p
-    ><p
-    >The key point about the transformer version <code
-      >ProgramT</code
-      > is that in addition to the monad laws, it automatically satisfies the lifting laws for monad transformers as well</p
-    ><pre
-    ><code
-      >lift . return        =  return
-lift m &gt;&gt;= lift . g  =  lift (m &gt;&gt;= g)
-</code
-      ></pre
-    ><p
-    >The corresponding view function <code
-      >viewT</code
-      > now returns the type <code
-      >m (ViewT instr m a)</code
-      >. It's not immediately apparent why this return type will do, but it's straightforward to work with, like in the following implementation of the list monad transformer:</p
-    ><pre
-    ><code
-      >data PlusI m a where
-    Zero :: PlusI m a
-    Plus :: ListT m a -&gt; ListT m a -&gt; PlusI m a
-
-type ListT m a = ProgramT (PlusI m) m a
-
-runList :: Monad m =&gt; ListT m a -&gt; m [a]
-runList = eval &lt;=&lt; viewT
-    where
-    eval :: Monad m =&gt; ProgramViewT (PlusI m) m a -&gt; m [a]
-    eval (Return x)        = return [x]
-    eval (Zero     :&gt;&gt;= k) = return []
-    eval (Plus m n :&gt;&gt;= k) =
-        liftM2 (++) (runList (m &gt;&gt;= k)) (runList (n &gt;&gt;= k))
-</code
-      ></pre
-    ></div
-  ><div id="alternatives-to-monad-transformers"
-  ><h2
-    ><a href="#TOC"
-      ><span class="header-section-number"
-	>2.4</span
-	> Alternatives to Monad Transformers</a
-      ></h2
-    ><p
-    >By the way, note that monad transformers are not the only way to build larger monads from smaller ones; a similar effect can be achieved with the direct sum of instructions sets. For instance, the monad</p
-    ><pre
-    ><code
-      >Program (StateI s :+: ExceptionI e) a
-
-data (f :+: g) a = Inl (f a) | Inr (g a)  -- a fancy  Either
-</code
-      ></pre
-    ><p
-    >is a combination of the state monad</p
-    ><pre
-    ><code
-      >type State a = Program (StateI s) a
-
-data StateI s a where
-    Put :: s -&gt; StateI s ()
-    Get :: StateI s s
-</code
-      ></pre
-    ><p
-    >and the error monad</p
-    ><pre
-    ><code
-      >type Error e a = Program (ErrorI e) a
-
-data ErrorI e a where
-    Throw :: e -&gt; ErrorI e ()
-    Catch :: ErrorI e a -&gt; (e -&gt; ErrorI e a) -&gt; ErrorI e a
-</code
-      ></pre
-    ><p
-    >The &quot;sum of signatures&quot; approach and the <code
-      >(:+:)</code
-      > type constructor are advocated in <a href="http://www.cse.chalmers.se/~wouter/Publications/DataTypesALaCarte.pdf" title="Wouter Swierstra. Data types &#65533; la carte."
-      >Wouter Swierstra's &quot;Data Types a la carte&quot;</a
-      >. Time will tell which has more merit; for now I have opted for a seamless interaction with monad transformers.</p
-    ></div
-  ></div
-><div id="design-and-implementation"
-><h1
-  ><a href="#TOC"
-    ><span class="header-section-number"
-      >3</span
-      > Design and Implementation</a
-    ></h1
-  ><div id="proof-of-the-monad-laws-sketch"
-  ><h2
-    ><a href="#TOC"
-      ><span class="header-section-number"
-	>3.1</span
-	> Proof of the monad laws (Sketch)</a
-      ></h2
-    ><p
-    >The key point of this library is of course that the <code
-      >view</code
-      > and <code
-      >viewT</code
-      > functions respect the monad laws. While this seems obvious from the definition, the proof is actually not straightforward.</p
-    ><p
-    >First, we restrict ourselves to <code
-      >view</code
-      >, i.e. the version without monad transformers. In fact, I don't have a full proof for the version with monad transformers, more about that in the next section.</p
-    ><p
-    >Second, we use a sloppy, but much more suitable notation, namely we write</p
-    ><table
-    ><tr class="header"
-      ><th align="left"
-	></th
-	><th align="center"
-	></th
-	></tr
-      ><tr class="odd"
-      ><td align="left"
-	><code
-	  >&gt;&gt;=</code
-	  ></td
-	><td align="center"
-	>instead of <code
-	  >Bind</code
-	  ></td
-	></tr
-      ><tr class="even"
-      ><td align="left"
-	><code
-	  >return</code
-	  ></td
-	><td align="center"
-	>instead of <code
-	  >Lift</code
-	  > for the identity monad</td
-	></tr
-      ><tr class="odd"
-      ><td align="left"
-	><code
-	  >i,j,k,</code
-	  >...</td
-	><td align="center"
-	>for primitive instructions</td
-	></tr
-      ></table
-    ><p
-    >Then, the <code
-      >view</code
-      > function becomes</p
-    ><pre
-    ><code
-      >view (return a)        = Return a
-view (return a  &gt;&gt;= g) = g a                           -- left unit
-view ((m &gt;&gt;= f) &gt;&gt;= g) = view (m &gt;&gt;= (\x -&gt; f x &gt;&gt;= g) -- associativity
-view (i         &gt;&gt;= g) = i :&gt;&gt;= g
-view  i                = i :&gt;&gt;= return                 -- right unit
-</code
-      ></pre
-    ><p
-    >Clearly, <code
-      >view</code
-      > uses the monad laws to rewrite it's argument. But we want to show that whenever two expressions</p
-    ><pre
-    ><code
-      >e1,e2 :: Program instr a
-</code
-      ></pre
-    ><p
-    >can be transformed into each other by rewriting them with the monad laws in <em
-      >any</em
-      > fashion (remember that <code
-      >&gt;&gt;=</code
-      > and <code
-      >return</code
-      > are constructors), then <code
-      >view</code
-      > will map them to the same result. More formally, we have an equivalence relation</p
-    ><pre
-    ><code
-      >e1 ~ e2   iff   e1 and e2 are the same modulo monad laws
-</code
-      ></pre
-    ><p
-    >and want to show</p
-    ><pre
-    ><code
-      >e1 ~ e2  =&gt;   view e1 = view e2    (some notion of equality)
-</code
-      ></pre
-    ><p
-    >Now, this needs proof because <code
-      >view</code
-      > is like a term rewriting system and there is no guarantee that two equivalent terms will be rewritten to the same normal form.</p
-    ><p
-    >Trying to attack this problem with term rewriting and critical pairs is probably hopeless and not very enlightening. After all, the theorem should be obvious because two equivalent expressions should have the same <em
-      >first instruction</em
-      > <code
-      >i</code
-      >. Well, we can formalize this with the help of a <em
-      >normal form</em
-      ></p
-    ><pre
-    ><code
-      >data NF instr a where
-    Return' :: a -&gt; NF instr a
-    (:&gt;&gt;=') :: instr a -&gt; (a -&gt; NF instr b) -&gt; NF instr b
-</code
-      ></pre
-    ><p
-    >This is the old program type and the key observation is that <code
-      >NF instr</code
-      > is already a monad.</p
-    ><pre
-    ><code
-      >instance Monad (NF inst) where
-    (Return' a) &gt;&gt;= g = g a
-    (m :&gt;&gt;=' f) &gt;&gt;= g = m :&gt;&gt;= (\x -&gt; f x &gt;&gt;= g)
-</code
-      ></pre
-    ><p
-    >(I'll skip the short calculation and coinduction argument that this really fulfills the monad laws.) We can define a normalization function</p
-    ><pre
-    ><code
-      >normalize :: Program instr a -&gt; NF instr a
-normalize (m &gt;&gt;= g)  = normalize m &gt;&gt;=' normalize g
-normalize (return a) = Return' a
-normalize  i         = i :&gt;&gt;=' Return'
-</code
-      ></pre
-    ><p
-    >which has the now obvious property that</p
-    ><pre
-    ><code
-      >e1 ~ e2  =&gt;  normalize e1 = normalize e2
-</code
-      ></pre
-    ><p
-    >Now, the return type of <code
-      >view</code
-      > is akin to a <em
-      >head normal form</em
-      >, hence</p
-    ><pre
-    ><code
-      >   normalize (view e1) = normalize (view e2) 
-=&gt; view e1 = view e2
-</code
-      ></pre
-    ><p
-    >(for some suitable extension of <code
-      >normalize</code
-      > to the <code
-      >ProgramView</code
-      > type.) But since <code
-      >view</code
-      > only uses monad laws to rewrite its argument, we also have</p
-    ><pre
-    ><code
-      >e1 ~ view e1  =&gt;  normalize e1 = normalize (view e1)
-</code
-      ></pre
-    ><p
-    >and this concludes the proof, which pretty much only showed that two equivalent expressions have the same instruction list and hence <code
-      >view</code
-      > gives equal results.</p
-    ></div
-  ><div id="monad-transformers-1"
-  ><h2
-    ><a href="#TOC"
-      ><span class="header-section-number"
-	>3.2</span
-	> Monad Transformers</a
-      ></h2
-    ><p
-    >The monad transformer case is more hairy, I have no proof here. (If you read this by accident: don't worry, it's still correct. This is for proof nerds only.)</p
-    ><p
-    >The main difficulty is that the equation</p
-    ><pre
-    ><code
-      >return = lift . return
-</code
-      ></pre
-    ><p
-    >is an equation for the already existing <code
-      >return</code
-      > constructor and the notion of &quot;first instruction&quot; no longer applies. Namely, we have</p
-    ><pre
-    ><code
-      >m  =  return m &gt;&gt;= id  =  lift (return m) &gt;&gt;= id
-</code
-      ></pre
-    ><p
-    >and it's not longer clear what a suitable normal form might be. It appears that <code
-      >viewT</code
-      > rewrites the term as follows</p
-    ><pre
-    ><code
-      >  lift m &gt;&gt;= g
-= lift m &gt;&gt;= (\x -&gt; lift (return (g x)) &gt;&gt;= id)
-= (lift m &gt;&gt;= lift . return . g) &gt;&gt;= id
-= lift (m &gt;&gt;= return . g) &gt;&gt;= id
-</code
-      ></pre
-    ><p
-    >(To be continued.)</p
-    ></div
-  ></div
-><div id="other-design-choices"
-><h1
-  ><a href="#TOC"
-    ><span class="header-section-number"
-      >4</span
-      > Other Design Choices</a
-    ></h1
-  ><div id="recursive-type-definitions-with-Program"
-  ><h2
-    ><a href="#TOC"
-      ><span class="header-section-number"
-	>4.1</span
-	> Recursive type definitions with <code
-	>Program</code
-	></a
-      ></h2
-    ><p
-    >In the <a href="http://web.cecs.pdx.edu/~cklin/papers/unimo-143.pdf" title="Chuan-kai Lin. Programming Monads Operationally with Unimo."
-      >unimo paper</a
-      >, the instructions carry an additional parameter that &quot;unties&quot; recursive type definition. For example, the instructions for <code
-      >MonadPlus</code
-      > are written</p
-    ><pre
-    ><code
-      >data PlusI unimo a where
-    Zero :: PlusI unimo a
-    Plus :: unimo a -&gt; unimo a -&gt; PlusI unimo a
-</code
-      ></pre
-    ><p
-    >The type constructor variable <code
-      >unimo</code
-      > will be tied to <code
-      >Unimo PlusI</code
-      >.</p
-    ><p
-    >In this library, I have opted for the conceptually simpler approach that requires the user to tie the recursion himself</p
-    ><pre
-    ><code
-      >data PlusI a where
-    Zero :: PlusI a
-    Plus :: Program PlusI a -&gt; Program PlusI a -&gt; Plus I a
-</code
-      ></pre
-    ><p
-    >I am not sure whether this has major consequences for composeablity; at the moment I believe that the former style can always be recovered from an implementation in the latter style.</p
-    ></div
-  ></div
->
-</body>
-</html>
-
diff --git a/docs/web/examples.html b/docs/web/examples.html
deleted file mode 100644
--- a/docs/web/examples.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<html><head><title>The 'operational' package - Example Code</title></head>
-<body>
-<h1>Example Code</h1>
-for the <a href="http://projects.haskell.org/operational/">operational</a> package.
-
-<h2>List of examples</h2>
-
-<dl>
-<dt><a href="examples/LogicT.hs.html">LogicT.hs</a>
-    <dd>Oleg Kiselyov's <code>LogicT</code> monad transformer.
-<dt><a href="examples/ListT.hs.html">ListT.hs</a>
-    <dd>Correct implementation of the list monad transformer.
-<dt><a href="examples/PoorMansConcurrency.hs.html">PoorMansConcurrency.hs</a>
-    <dd>Koen Claessen's poor man's concurrency monad, implements cooperative multitasking.
-<dt><a href="examples/State.hs.html">State.hs</a>
-    <dd>Very simple example showing how to implement the state monad.
-<dt><a href="examples/TicTacToe.hs.html">TicTacToe.hs</a>
-    <dd>The game of TicTacToe. Mix and mash humans and AI as you like; players are implemented in a special monad that looks like there is only one player playing.
-<dt><a href="examples/WebSessionState.lhs.html">WebSessionState.lhs</a>
-    <dd>CGI Script that is written in a style seems to require exeution in a persistent process, but actually stores a log of the session in the client.
-</dl>
-
-<h2>Download</h2>
-Download a <a href="examples/operational-examples.tar.gz">tar.gz archive</a> of all the current examples.
-
-</body></html>
diff --git a/docs/web/examples/ListT.hs.html b/docs/web/examples/ListT.hs.html
deleted file mode 100644
--- a/docs/web/examples/ListT.hs.html
+++ /dev/null
@@ -1,66 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html>
-<head>
-<!-- Generated by HsColour, http://www.cs.york.ac.uk/fp/darcs/hscolour/ -->
-<title>examples/ListT.hs</title>
-<link type='text/css' rel='stylesheet' href='hscolour.css' />
-</head>
-<body>
-<pre><span class='hs-comment'>{------------------------------------------------------------------------------
-    Control.Monad.Operational
-    
-    Example:
-    List Monad Transformer
-
-------------------------------------------------------------------------------}</span>
-<span class='hs-comment'>{-# LANGUAGE GADTs, Rank2Types, FlexibleInstances #-}</span>
-<span class='hs-keyword'>module</span> <span class='hs-conid'>ListT</span> <span class='hs-keyword'>where</span>
-
-<span class='hs-keyword'>import</span> <span class='hs-conid'>Control</span><span class='hs-varop'>.</span><span class='hs-conid'>Monad</span>
-<span class='hs-keyword'>import</span> <span class='hs-conid'>Control</span><span class='hs-varop'>.</span><span class='hs-conid'>Monad</span><span class='hs-varop'>.</span><span class='hs-conid'>Operational</span>
-<span class='hs-keyword'>import</span> <span class='hs-conid'>Control</span><span class='hs-varop'>.</span><span class='hs-conid'>Monad</span><span class='hs-varop'>.</span><span class='hs-conid'>Trans</span>
-
-<span class='hs-comment'>{------------------------------------------------------------------------------
-    A direct implementation
-        type ListT m a = m [a]
-    would violate the monad laws, but we don't have that problem.
-------------------------------------------------------------------------------}</span>
-<span class='hs-keyword'>data</span> <span class='hs-conid'>MPlus</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span> <span class='hs-keyword'>where</span>
-    <span class='hs-conid'>MZero</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>MPlus</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span>
-    <span class='hs-conid'>MPlus</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>ListT</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>ListT</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>MPlus</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span>
-
-<span class='hs-keyword'>type</span> <span class='hs-conid'>ListT</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>ProgramT</span> <span class='hs-layout'>(</span><span class='hs-conid'>MPlus</span> <span class='hs-varid'>m</span><span class='hs-layout'>)</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span>
-
-    <span class='hs-comment'>-- *sigh* I want to use type synonyms for type constructors, too;</span>
-    <span class='hs-comment'>-- GHC doesn't accept  MonadMPlus (ListT m)</span>
-<span class='hs-keyword'>instance</span> <span class='hs-conid'>Monad</span> <span class='hs-varid'>m</span> <span class='hs-keyglyph'>=&gt;</span> <span class='hs-conid'>MonadPlus</span> <span class='hs-layout'>(</span><span class='hs-conid'>ProgramT</span> <span class='hs-layout'>(</span><span class='hs-conid'>MPlus</span> <span class='hs-varid'>m</span><span class='hs-layout'>)</span> <span class='hs-varid'>m</span><span class='hs-layout'>)</span> <span class='hs-keyword'>where</span>
-    <span class='hs-varid'>mzero</span>     <span class='hs-keyglyph'>=</span> <span class='hs-varid'>singleton</span> <span class='hs-conid'>MZero</span>
-    <span class='hs-varid'>mplus</span> <span class='hs-varid'>m</span> <span class='hs-varid'>n</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>singleton</span> <span class='hs-layout'>(</span><span class='hs-conid'>MPlus</span> <span class='hs-varid'>m</span> <span class='hs-varid'>n</span><span class='hs-layout'>)</span>
-
-<span class='hs-definition'>runListT</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Monad</span> <span class='hs-varid'>m</span> <span class='hs-keyglyph'>=&gt;</span> <span class='hs-conid'>ListT</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>m</span> <span class='hs-keyglyph'>[</span><span class='hs-varid'>a</span><span class='hs-keyglyph'>]</span>
-<span class='hs-definition'>runListT</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>eval</span> <span class='hs-varop'>&lt;=&lt;</span> <span class='hs-varid'>viewT</span>
-    <span class='hs-keyword'>where</span>
-    <span class='hs-varid'>eval</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Monad</span> <span class='hs-varid'>m</span> <span class='hs-keyglyph'>=&gt;</span> <span class='hs-conid'>ProgramViewT</span> <span class='hs-layout'>(</span><span class='hs-conid'>MPlus</span> <span class='hs-varid'>m</span><span class='hs-layout'>)</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>m</span> <span class='hs-keyglyph'>[</span><span class='hs-varid'>a</span><span class='hs-keyglyph'>]</span>
-    <span class='hs-varid'>eval</span> <span class='hs-layout'>(</span><span class='hs-conid'>Return</span> <span class='hs-varid'>x</span><span class='hs-layout'>)</span>         <span class='hs-keyglyph'>=</span> <span class='hs-varid'>return</span> <span class='hs-keyglyph'>[</span><span class='hs-varid'>x</span><span class='hs-keyglyph'>]</span>
-    <span class='hs-varid'>eval</span> <span class='hs-layout'>(</span><span class='hs-conid'>MZero</span>     <span class='hs-conop'>:&gt;&gt;=</span> <span class='hs-varid'>k</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>return</span> <span class='hs-conid'>[]</span>
-    <span class='hs-varid'>eval</span> <span class='hs-layout'>(</span><span class='hs-conid'>MPlus</span> <span class='hs-varid'>m</span> <span class='hs-varid'>n</span> <span class='hs-conop'>:&gt;&gt;=</span> <span class='hs-varid'>k</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span>
-        <span class='hs-varid'>liftM2</span> <span class='hs-layout'>(</span><span class='hs-varop'>++</span><span class='hs-layout'>)</span> <span class='hs-layout'>(</span><span class='hs-varid'>runListT</span> <span class='hs-layout'>(</span><span class='hs-varid'>m</span> <span class='hs-varop'>&gt;&gt;=</span> <span class='hs-varid'>k</span><span class='hs-layout'>)</span><span class='hs-layout'>)</span> <span class='hs-layout'>(</span><span class='hs-varid'>runListT</span> <span class='hs-layout'>(</span><span class='hs-varid'>n</span> <span class='hs-varop'>&gt;&gt;=</span> <span class='hs-varid'>k</span><span class='hs-layout'>)</span><span class='hs-layout'>)</span>
-
-<span class='hs-definition'>testListT</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>IO</span> <span class='hs-keyglyph'>[</span><span class='hs-conid'>()</span><span class='hs-keyglyph'>]</span>
-<span class='hs-definition'>testListT</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>runListT</span> <span class='hs-varop'>$</span> <span class='hs-keyword'>do</span>
-    <span class='hs-varid'>n</span> <span class='hs-keyglyph'>&lt;-</span> <span class='hs-varid'>choice</span> <span class='hs-keyglyph'>[</span><span class='hs-num'>1</span><span class='hs-keyglyph'>..</span><span class='hs-num'>5</span><span class='hs-keyglyph'>]</span>
-    <span class='hs-varid'>lift</span> <span class='hs-varop'>.</span> <span class='hs-varid'>print</span> <span class='hs-varop'>$</span> <span class='hs-str'>"You've chosen the number: "</span> <span class='hs-varop'>++</span> <span class='hs-varid'>show</span> <span class='hs-varid'>n</span>
-    <span class='hs-keyword'>where</span>
-    <span class='hs-varid'>choice</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>foldr1</span> <span class='hs-varid'>mplus</span> <span class='hs-varop'>.</span> <span class='hs-varid'>map</span> <span class='hs-varid'>return</span>
-
-
-    <span class='hs-comment'>-- testing the monad laws, from the Haskellwiki</span>
-    <span class='hs-comment'>-- <a href="http://www.haskell.org/haskellwiki/ListT_done_right#Order_of_printing">http://www.haskell.org/haskellwiki/ListT_done_right#Order_of_printing</a></span>
-<span class='hs-definition'>a</span><span class='hs-layout'>,</span><span class='hs-varid'>b</span><span class='hs-layout'>,</span><span class='hs-varid'>c</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>ListT</span> <span class='hs-conid'>IO</span> <span class='hs-conid'>()</span>
-<span class='hs-keyglyph'>[</span><span class='hs-varid'>a</span><span class='hs-layout'>,</span><span class='hs-varid'>b</span><span class='hs-layout'>,</span><span class='hs-varid'>c</span><span class='hs-keyglyph'>]</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>map</span> <span class='hs-layout'>(</span><span class='hs-varid'>lift</span> <span class='hs-varop'>.</span> <span class='hs-varid'>putChar</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>[</span><span class='hs-chr'>'a'</span><span class='hs-layout'>,</span><span class='hs-chr'>'b'</span><span class='hs-layout'>,</span><span class='hs-chr'>'c'</span><span class='hs-keyglyph'>]</span>
-
-    <span class='hs-comment'>-- t1 and t2 have to print the same sequence of letters</span>
-<span class='hs-definition'>t1</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>runListT</span> <span class='hs-varop'>$</span> <span class='hs-layout'>(</span><span class='hs-layout'>(</span><span class='hs-varid'>a</span> <span class='hs-varop'>`mplus`</span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span> <span class='hs-varop'>&gt;&gt;</span> <span class='hs-varid'>b</span><span class='hs-layout'>)</span> <span class='hs-varop'>&gt;&gt;</span> <span class='hs-varid'>c</span>
-<span class='hs-definition'>t2</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>runListT</span> <span class='hs-varop'>$</span> <span class='hs-layout'>(</span><span class='hs-varid'>a</span> <span class='hs-varop'>`mplus`</span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span> <span class='hs-varop'>&gt;&gt;</span> <span class='hs-layout'>(</span><span class='hs-varid'>b</span> <span class='hs-varop'>&gt;&gt;</span> <span class='hs-varid'>c</span><span class='hs-layout'>)</span>
-</pre></body>
-</html>
diff --git a/docs/web/examples/LogicT.hs.html b/docs/web/examples/LogicT.hs.html
deleted file mode 100644
--- a/docs/web/examples/LogicT.hs.html
+++ /dev/null
@@ -1,96 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html>
-<head>
-<!-- Generated by HsColour, http://www.cs.york.ac.uk/fp/darcs/hscolour/ -->
-<title>examples/LogicT.hs</title>
-<link type='text/css' rel='stylesheet' href='hscolour.css' />
-</head>
-<body>
-<pre><span class='hs-comment'>{------------------------------------------------------------------------------
-    Control.Monad.Operational
-    
-    Example:
-    Oleg's  LogicT  monad transformer
-    
-    Functions to implement are taken from the corresponding paper
-    <a href="http://okmij.org/ftp/papers/LogicT.pdf">http://okmij.org/ftp/papers/LogicT.pdf</a>
-    
-------------------------------------------------------------------------------}</span>
-<span class='hs-comment'>{-# LANGUAGE GADTs, Rank2Types #-}</span>
-<span class='hs-keyword'>module</span> <span class='hs-conid'>LogicT</span> <span class='hs-layout'>(</span><span class='hs-conid'>LogicT</span><span class='hs-layout'>,</span> <span class='hs-varid'>msplit</span><span class='hs-layout'>,</span> <span class='hs-varid'>observe</span><span class='hs-layout'>,</span> <span class='hs-varid'>bagOfN</span><span class='hs-layout'>,</span> <span class='hs-varid'>interleave</span><span class='hs-layout'>)</span> <span class='hs-keyword'>where</span>
-
-<span class='hs-keyword'>import</span> <span class='hs-conid'>Control</span><span class='hs-varop'>.</span><span class='hs-conid'>Monad</span>
-<span class='hs-keyword'>import</span> <span class='hs-conid'>Control</span><span class='hs-varop'>.</span><span class='hs-conid'>Monad</span><span class='hs-varop'>.</span><span class='hs-conid'>Operational</span>
-<span class='hs-keyword'>import</span> <span class='hs-conid'>Control</span><span class='hs-varop'>.</span><span class='hs-conid'>Monad</span><span class='hs-varop'>.</span><span class='hs-conid'>Trans</span>
-
-<span class='hs-keyword'>import</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>Maybe</span>
-
-<span class='hs-comment'>{------------------------------------------------------------------------------
-    LogicT
-    = A MonadPlus with an additional operation
-         msplit
-      which returns the first result and a computation to 
-      produce the remaining results.
-
-
-    For example, the function  msplit  satisfies the laws
-    
-        msplit mzero                 ~&gt; return Nothing
-        msplit (return a `mplus` m)  ~&gt; return (Just (a,m))
-    
-    It turns out that we don't have to make  msplit  a primitive,
-    we can implement it by inspection on the argument. In other
-    words,  LogicT  will be the same as the  ListT  monad transformer
-------------------------------------------------------------------------------}</span>
-<span class='hs-keyword'>import</span> <span class='hs-conid'>ListT</span>
-<span class='hs-keyword'>type</span> <span class='hs-conid'>LogicT</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>ListT</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span>
-
-    <span class='hs-comment'>-- msplit  is the lift of a function  split  in the base monad</span>
-<span class='hs-definition'>msplit</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Monad</span> <span class='hs-varid'>m</span> <span class='hs-keyglyph'>=&gt;</span> <span class='hs-conid'>LogicT</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>LogicT</span> <span class='hs-varid'>m</span> <span class='hs-layout'>(</span><span class='hs-conid'>Maybe</span> <span class='hs-layout'>(</span><span class='hs-varid'>a</span><span class='hs-layout'>,</span> <span class='hs-conid'>LogicT</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span><span class='hs-layout'>)</span>
-<span class='hs-definition'>msplit</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>lift</span> <span class='hs-varop'>.</span> <span class='hs-varid'>split</span>
-
-    <span class='hs-comment'>-- split  in the base monad</span>
-<span class='hs-definition'>split</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Monad</span> <span class='hs-varid'>m</span> <span class='hs-keyglyph'>=&gt;</span> <span class='hs-conid'>LogicT</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>m</span> <span class='hs-layout'>(</span><span class='hs-conid'>Maybe</span> <span class='hs-layout'>(</span><span class='hs-varid'>a</span><span class='hs-layout'>,</span> <span class='hs-conid'>LogicT</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span><span class='hs-layout'>)</span>
-<span class='hs-definition'>split</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>eval</span> <span class='hs-varop'>&lt;=&lt;</span> <span class='hs-varid'>viewT</span>
-    <span class='hs-keyword'>where</span>
-    <span class='hs-comment'>-- apply the laws for  msplit</span>
-    <span class='hs-varid'>eval</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Monad</span> <span class='hs-varid'>m</span> <span class='hs-keyglyph'>=&gt;</span> <span class='hs-conid'>ProgramViewT</span> <span class='hs-layout'>(</span><span class='hs-conid'>MPlus</span> <span class='hs-varid'>m</span><span class='hs-layout'>)</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>m</span> <span class='hs-layout'>(</span><span class='hs-conid'>Maybe</span> <span class='hs-layout'>(</span><span class='hs-varid'>a</span><span class='hs-layout'>,</span> <span class='hs-conid'>LogicT</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span><span class='hs-layout'>)</span>
-    <span class='hs-varid'>eval</span> <span class='hs-layout'>(</span><span class='hs-conid'>MZero</span>     <span class='hs-conop'>:&gt;&gt;=</span> <span class='hs-varid'>k</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>return</span> <span class='hs-conid'>Nothing</span>
-    <span class='hs-varid'>eval</span> <span class='hs-layout'>(</span><span class='hs-conid'>MPlus</span> <span class='hs-varid'>m</span> <span class='hs-varid'>n</span> <span class='hs-conop'>:&gt;&gt;=</span> <span class='hs-varid'>k</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span> <span class='hs-keyword'>do</span>
-        <span class='hs-varid'>ma</span> <span class='hs-keyglyph'>&lt;-</span> <span class='hs-varid'>split</span> <span class='hs-layout'>(</span><span class='hs-varid'>m</span> <span class='hs-varop'>&gt;&gt;=</span> <span class='hs-varid'>k</span><span class='hs-layout'>)</span>
-        <span class='hs-keyword'>case</span> <span class='hs-varid'>ma</span> <span class='hs-keyword'>of</span>
-            <span class='hs-conid'>Nothing</span>     <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>split</span> <span class='hs-layout'>(</span><span class='hs-varid'>n</span> <span class='hs-varop'>&gt;&gt;=</span> <span class='hs-varid'>k</span><span class='hs-layout'>)</span>
-            <span class='hs-conid'>Just</span> <span class='hs-layout'>(</span><span class='hs-varid'>a</span><span class='hs-layout'>,</span><span class='hs-varid'>m'</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>return</span> <span class='hs-varop'>$</span> <span class='hs-conid'>Just</span> <span class='hs-layout'>(</span><span class='hs-varid'>a</span><span class='hs-layout'>,</span> <span class='hs-varid'>m'</span> <span class='hs-varop'>`mplus`</span> <span class='hs-layout'>(</span><span class='hs-varid'>n</span> <span class='hs-varop'>&gt;&gt;=</span> <span class='hs-varid'>k</span><span class='hs-layout'>)</span><span class='hs-layout'>)</span>
-                                <span class='hs-comment'>--            inefficient!</span>
-                                <span class='hs-comment'>-- `mplus` will add another (&gt;&gt;= return)</span>
-                                <span class='hs-comment'>-- to  n  each time it's called.</span>
-                                <span class='hs-comment'>-- Curing this is not easy.</span>
-
-    <span class='hs-comment'>-- main interpreter, section 6 in the paper</span>
-    <span class='hs-comment'>-- returns the first result, if any; may fail</span>
-<span class='hs-definition'>observe</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Monad</span> <span class='hs-varid'>m</span> <span class='hs-keyglyph'>=&gt;</span> <span class='hs-conid'>LogicT</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span>
-<span class='hs-definition'>observe</span> <span class='hs-varid'>m</span> <span class='hs-keyglyph'>=</span> <span class='hs-layout'>(</span><span class='hs-varid'>fst</span> <span class='hs-varop'>.</span> <span class='hs-varid'>fromJust</span><span class='hs-layout'>)</span> <span class='hs-varop'>`liftM`</span> <span class='hs-varid'>split</span> <span class='hs-varid'>m</span>
-
-<span class='hs-comment'>{------------------------------------------------------------------------------
-    Derived functions from the paper
-------------------------------------------------------------------------------}</span>
-    <span class='hs-comment'>-- return the first n results, section 6</span>
-<span class='hs-definition'>bagOfN</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Monad</span> <span class='hs-varid'>m</span> <span class='hs-keyglyph'>=&gt;</span> <span class='hs-conid'>Maybe</span> <span class='hs-conid'>Int</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>LogicT</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>LogicT</span> <span class='hs-varid'>m</span> <span class='hs-keyglyph'>[</span><span class='hs-varid'>a</span><span class='hs-keyglyph'>]</span>
-<span class='hs-definition'>bagOfN</span> <span class='hs-layout'>(</span><span class='hs-conid'>Just</span> <span class='hs-varid'>n</span><span class='hs-layout'>)</span> <span class='hs-varid'>m</span> <span class='hs-keyglyph'>|</span> <span class='hs-varid'>n</span> <span class='hs-varop'>&lt;=</span> <span class='hs-num'>0</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>return</span> <span class='hs-conid'>[]</span>
-<span class='hs-definition'>bagOfN</span> <span class='hs-varid'>n</span> <span class='hs-varid'>m</span>                 <span class='hs-keyglyph'>=</span> <span class='hs-varid'>msplit</span> <span class='hs-varid'>m</span> <span class='hs-varop'>&gt;&gt;=</span> <span class='hs-varid'>bagofN'</span>
-    <span class='hs-keyword'>where</span>
-    <span class='hs-varid'>bagofN'</span> <span class='hs-conid'>Nothing</span>         <span class='hs-keyglyph'>=</span> <span class='hs-varid'>return</span> <span class='hs-conid'>[]</span>
-    <span class='hs-varid'>bagofN'</span> <span class='hs-layout'>(</span><span class='hs-conid'>Just</span> <span class='hs-layout'>(</span><span class='hs-varid'>x</span><span class='hs-layout'>,</span><span class='hs-varid'>m'</span><span class='hs-layout'>)</span><span class='hs-layout'>)</span>   <span class='hs-keyglyph'>=</span> <span class='hs-layout'>(</span><span class='hs-varid'>x</span><span class='hs-conop'>:</span><span class='hs-layout'>)</span> <span class='hs-varop'>`liftM`</span> <span class='hs-varid'>bagOfN</span> <span class='hs-layout'>(</span><span class='hs-varid'>fmap</span> <span class='hs-varid'>pred</span>  <span class='hs-varid'>n</span><span class='hs-layout'>)</span> <span class='hs-varid'>m'</span>
-                            <span class='hs-keyword'>where</span> <span class='hs-varid'>pred</span> <span class='hs-varid'>n</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>n</span><span class='hs-comment'>-</span><span class='hs-num'>1</span>
-
-    <span class='hs-comment'>-- interleave</span>
-<span class='hs-definition'>interleave</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Monad</span> <span class='hs-varid'>m</span> <span class='hs-keyglyph'>=&gt;</span> <span class='hs-conid'>LogicT</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>LogicT</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>LogicT</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span>
-<span class='hs-definition'>interleave</span> <span class='hs-varid'>m1</span> <span class='hs-varid'>m2</span> <span class='hs-keyglyph'>=</span> <span class='hs-keyword'>do</span>
-    <span class='hs-varid'>r</span> <span class='hs-keyglyph'>&lt;-</span> <span class='hs-varid'>msplit</span> <span class='hs-varid'>m1</span>
-    <span class='hs-keyword'>case</span> <span class='hs-varid'>r</span> <span class='hs-keyword'>of</span>
-        <span class='hs-conid'>Nothing</span>      <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>m2</span>
-        <span class='hs-conid'>Just</span> <span class='hs-layout'>(</span><span class='hs-varid'>a</span><span class='hs-layout'>,</span><span class='hs-varid'>m1'</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>return</span> <span class='hs-varid'>a</span> <span class='hs-varop'>`mplus`</span> <span class='hs-varid'>interleave</span> <span class='hs-varid'>m2</span> <span class='hs-varid'>m1'</span>
-
-
-</pre></body>
-</html>
diff --git a/docs/web/examples/PoorMansConcurrency.hs.html b/docs/web/examples/PoorMansConcurrency.hs.html
deleted file mode 100644
--- a/docs/web/examples/PoorMansConcurrency.hs.html
+++ /dev/null
@@ -1,73 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html>
-<head>
-<!-- Generated by HsColour, http://www.cs.york.ac.uk/fp/darcs/hscolour/ -->
-<title>examples/PoorMansConcurrency.hs</title>
-<link type='text/css' rel='stylesheet' href='hscolour.css' />
-</head>
-<body>
-<pre><span class='hs-comment'>{------------------------------------------------------------------------------
-    Control.Monad.Operational
-    
-    Example:
-    Koen Claessen's Poor Man's Concurrency Monad
-    <a href="http://www.cs.chalmers.se/~koen/pubs/entry-jfp99-monad.html">http://www.cs.chalmers.se/~koen/pubs/entry-jfp99-monad.html</a>
-
-------------------------------------------------------------------------------}</span>
-<span class='hs-comment'>{-# LANGUAGE GADTs, Rank2Types #-}</span>
-<span class='hs-keyword'>module</span> <span class='hs-conid'>PoorMansConcurrency</span> <span class='hs-keyword'>where</span>
-
-<span class='hs-keyword'>import</span> <span class='hs-conid'>Control</span><span class='hs-varop'>.</span><span class='hs-conid'>Monad</span>
-<span class='hs-keyword'>import</span> <span class='hs-conid'>Control</span><span class='hs-varop'>.</span><span class='hs-conid'>Monad</span><span class='hs-varop'>.</span><span class='hs-conid'>Operational</span>
-<span class='hs-keyword'>import</span> <span class='hs-conid'>Control</span><span class='hs-varop'>.</span><span class='hs-conid'>Monad</span><span class='hs-varop'>.</span><span class='hs-conid'>Trans</span> <span class='hs-varid'>hiding</span> <span class='hs-layout'>(</span><span class='hs-varid'>lift</span><span class='hs-layout'>)</span>
-
-<span class='hs-comment'>{------------------------------------------------------------------------------
-    A concurrency monad runs several processes in parallel
-    and supports two operations
-
-        fork  -- fork a new process
-        stop  -- halt the current one
-    
-    We want this to be a monad transformer, so we also need a function  lift
-    This time, however, we cannot use the monad transformer version  ProgramT
-    because this will leave no room for interleaving different computations
-    of the base monad.
-------------------------------------------------------------------------------}</span>
-<span class='hs-keyword'>data</span> <span class='hs-conid'>ProcessI</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span> <span class='hs-keyword'>where</span>
-    <span class='hs-conid'>Lift</span> <span class='hs-keyglyph'>::</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>ProcessI</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span>
-    <span class='hs-conid'>Stop</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>ProcessI</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span>
-    <span class='hs-conid'>Fork</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Process</span> <span class='hs-varid'>m</span> <span class='hs-conid'>()</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>ProcessI</span> <span class='hs-varid'>m</span> <span class='hs-conid'>()</span>
-
-
-<span class='hs-keyword'>type</span> <span class='hs-conid'>Process</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Program</span> <span class='hs-layout'>(</span><span class='hs-conid'>ProcessI</span> <span class='hs-varid'>m</span><span class='hs-layout'>)</span> <span class='hs-varid'>a</span>
-
-<span class='hs-definition'>stop</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>singleton</span> <span class='hs-conid'>Stop</span>
-<span class='hs-definition'>fork</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>singleton</span> <span class='hs-varop'>.</span> <span class='hs-conid'>Fork</span>
-<span class='hs-definition'>lift</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>singleton</span> <span class='hs-varop'>.</span> <span class='hs-conid'>Lift</span>
-
-    <span class='hs-comment'>-- interpreter</span>
-<span class='hs-definition'>runProcess</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Monad</span> <span class='hs-varid'>m</span> <span class='hs-keyglyph'>=&gt;</span> <span class='hs-conid'>Process</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>m</span> <span class='hs-conid'>()</span>
-<span class='hs-definition'>runProcess</span> <span class='hs-varid'>m</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>schedule</span> <span class='hs-keyglyph'>[</span><span class='hs-varid'>m</span><span class='hs-keyglyph'>]</span>
-    <span class='hs-keyword'>where</span>
-    <span class='hs-varid'>schedule</span> <span class='hs-layout'>(</span><span class='hs-varid'>x</span><span class='hs-conop'>:</span><span class='hs-varid'>xs</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>run</span> <span class='hs-layout'>(</span><span class='hs-varid'>view</span> <span class='hs-varid'>x</span><span class='hs-layout'>)</span> <span class='hs-varid'>xs</span>
-
-    <span class='hs-varid'>run</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Monad</span> <span class='hs-varid'>m</span> <span class='hs-keyglyph'>=&gt;</span> <span class='hs-conid'>ProgramView</span> <span class='hs-layout'>(</span><span class='hs-conid'>ProcessI</span> <span class='hs-varid'>m</span><span class='hs-layout'>)</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-keyglyph'>[</span><span class='hs-conid'>Process</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span><span class='hs-keyglyph'>]</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>m</span> <span class='hs-conid'>()</span>
-    <span class='hs-varid'>run</span> <span class='hs-layout'>(</span><span class='hs-conid'>Return</span> <span class='hs-keyword'>_</span><span class='hs-layout'>)</span>      <span class='hs-varid'>xs</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>return</span> <span class='hs-conid'>()</span>                 <span class='hs-comment'>-- process finished</span>
-    <span class='hs-varid'>run</span> <span class='hs-layout'>(</span><span class='hs-conid'>Lift</span> <span class='hs-varid'>m</span> <span class='hs-conop'>:&gt;&gt;=</span> <span class='hs-varid'>k</span><span class='hs-layout'>)</span> <span class='hs-varid'>xs</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>m</span> <span class='hs-varop'>&gt;&gt;=</span> <span class='hs-keyglyph'>\</span><span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span>               <span class='hs-comment'>-- switch process</span>
-                             <span class='hs-varid'>schedule</span> <span class='hs-layout'>(</span><span class='hs-varid'>xs</span> <span class='hs-varop'>++</span> <span class='hs-keyglyph'>[</span><span class='hs-varid'>k</span> <span class='hs-varid'>a</span><span class='hs-keyglyph'>]</span><span class='hs-layout'>)</span>
-    <span class='hs-varid'>run</span> <span class='hs-layout'>(</span><span class='hs-conid'>Stop</span>   <span class='hs-conop'>:&gt;&gt;=</span> <span class='hs-varid'>k</span><span class='hs-layout'>)</span> <span class='hs-varid'>xs</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>schedule</span> <span class='hs-varid'>xs</span>               <span class='hs-comment'>-- process halts</span>
-    <span class='hs-varid'>run</span> <span class='hs-layout'>(</span><span class='hs-conid'>Fork</span> <span class='hs-varid'>p</span> <span class='hs-conop'>:&gt;&gt;=</span> <span class='hs-varid'>k</span><span class='hs-layout'>)</span> <span class='hs-varid'>xs</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>schedule</span> <span class='hs-layout'>(</span><span class='hs-varid'>xs</span> <span class='hs-varop'>++</span> <span class='hs-keyglyph'>[</span><span class='hs-varid'>x2</span><span class='hs-layout'>,</span><span class='hs-varid'>x1</span><span class='hs-keyglyph'>]</span><span class='hs-layout'>)</span>  <span class='hs-comment'>-- fork new process</span>
-        <span class='hs-keyword'>where</span> <span class='hs-varid'>x1</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>k</span> <span class='hs-conid'>()</span><span class='hs-layout'>;</span> <span class='hs-varid'>x2</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>p</span> <span class='hs-varop'>&gt;&gt;=</span> <span class='hs-varid'>k</span>
-
-    <span class='hs-comment'>-- example</span>
-    <span class='hs-comment'>--      &gt; runProcess example   -- warning: runs indefinitely</span>
-<span class='hs-definition'>example</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Process</span> <span class='hs-conid'>IO</span> <span class='hs-conid'>()</span>
-<span class='hs-definition'>example</span> <span class='hs-keyglyph'>=</span> <span class='hs-keyword'>do</span>
-        <span class='hs-varid'>write</span> <span class='hs-str'>"Start!"</span>
-        <span class='hs-varid'>fork</span> <span class='hs-layout'>(</span><span class='hs-varid'>loop</span> <span class='hs-str'>"fish"</span><span class='hs-layout'>)</span>
-        <span class='hs-varid'>loop</span> <span class='hs-str'>"cat"</span>
-
-<span class='hs-definition'>write</span>  <span class='hs-keyglyph'>=</span> <span class='hs-varid'>lift</span> <span class='hs-varop'>.</span> <span class='hs-varid'>putStr</span>
-<span class='hs-definition'>loop</span> <span class='hs-varid'>s</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>write</span> <span class='hs-varid'>s</span> <span class='hs-varop'>&gt;&gt;</span> <span class='hs-varid'>loop</span> <span class='hs-varid'>s</span>
-</pre></body>
-</html>
diff --git a/docs/web/examples/State.hs.html b/docs/web/examples/State.hs.html
deleted file mode 100644
--- a/docs/web/examples/State.hs.html
+++ /dev/null
@@ -1,70 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html>
-<head>
-<!-- Generated by HsColour, http://www.cs.york.ac.uk/fp/darcs/hscolour/ -->
-<title>examples/State.hs</title>
-<link type='text/css' rel='stylesheet' href='hscolour.css' />
-</head>
-<body>
-<pre><span class='hs-comment'>{------------------------------------------------------------------------------
-    Control.Monad.Operational
-    
-    Example:
-    State monad and monad transformer
-    
-------------------------------------------------------------------------------}</span>
-<span class='hs-comment'>{-# LANGUAGE GADTs, Rank2Types, FlexibleInstances #-}</span>
-<span class='hs-keyword'>module</span> <span class='hs-conid'>State</span> <span class='hs-keyword'>where</span>
-
-<span class='hs-keyword'>import</span> <span class='hs-conid'>Control</span><span class='hs-varop'>.</span><span class='hs-conid'>Monad</span>
-<span class='hs-keyword'>import</span> <span class='hs-conid'>Control</span><span class='hs-varop'>.</span><span class='hs-conid'>Monad</span><span class='hs-varop'>.</span><span class='hs-conid'>Operational</span>
-<span class='hs-keyword'>import</span> <span class='hs-conid'>Control</span><span class='hs-varop'>.</span><span class='hs-conid'>Monad</span><span class='hs-varop'>.</span><span class='hs-conid'>Trans</span>
-
-<span class='hs-comment'>{------------------------------------------------------------------------------
-	State Monad
-------------------------------------------------------------------------------}</span>
-<span class='hs-keyword'>data</span> <span class='hs-conid'>StateI</span> <span class='hs-varid'>s</span> <span class='hs-varid'>a</span> <span class='hs-keyword'>where</span>
-    <span class='hs-conid'>Get</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>StateI</span> <span class='hs-varid'>s</span> <span class='hs-varid'>s</span>
-    <span class='hs-conid'>Put</span> <span class='hs-keyglyph'>::</span> <span class='hs-varid'>s</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>StateI</span> <span class='hs-varid'>s</span> <span class='hs-conid'>()</span>
-
-<span class='hs-keyword'>type</span> <span class='hs-conid'>State</span> <span class='hs-varid'>s</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Program</span> <span class='hs-layout'>(</span><span class='hs-conid'>StateI</span> <span class='hs-varid'>s</span><span class='hs-layout'>)</span> <span class='hs-varid'>a</span>
-
-<span class='hs-definition'>evalState</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>State</span> <span class='hs-varid'>s</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>s</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>a</span>
-<span class='hs-definition'>evalState</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>eval</span> <span class='hs-varop'>.</span> <span class='hs-varid'>view</span>
-    <span class='hs-keyword'>where</span>
-    <span class='hs-varid'>eval</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>ProgramView</span> <span class='hs-layout'>(</span><span class='hs-conid'>StateI</span> <span class='hs-varid'>s</span><span class='hs-layout'>)</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-layout'>(</span><span class='hs-varid'>s</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span>
-    <span class='hs-varid'>eval</span> <span class='hs-layout'>(</span><span class='hs-conid'>Return</span> <span class='hs-varid'>x</span><span class='hs-layout'>)</span>     <span class='hs-keyglyph'>=</span> <span class='hs-varid'>const</span> <span class='hs-varid'>x</span>
-    <span class='hs-varid'>eval</span> <span class='hs-layout'>(</span><span class='hs-conid'>Get</span>   <span class='hs-conop'>:&gt;&gt;=</span> <span class='hs-varid'>k</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span> <span class='hs-keyglyph'>\</span><span class='hs-varid'>s</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>evalState</span> <span class='hs-layout'>(</span><span class='hs-varid'>k</span> <span class='hs-varid'>s</span> <span class='hs-layout'>)</span> <span class='hs-varid'>s</span>
-    <span class='hs-varid'>eval</span> <span class='hs-layout'>(</span><span class='hs-conid'>Put</span> <span class='hs-varid'>s</span> <span class='hs-conop'>:&gt;&gt;=</span> <span class='hs-varid'>k</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span> <span class='hs-keyglyph'>\</span><span class='hs-keyword'>_</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>evalState</span> <span class='hs-layout'>(</span><span class='hs-varid'>k</span> <span class='hs-conid'>()</span><span class='hs-layout'>)</span> <span class='hs-varid'>s</span>
-
-<span class='hs-definition'>put</span> <span class='hs-keyglyph'>::</span> <span class='hs-varid'>s</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>StateT</span> <span class='hs-varid'>s</span> <span class='hs-varid'>m</span> <span class='hs-conid'>()</span>
-<span class='hs-definition'>put</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>singleton</span> <span class='hs-varop'>.</span> <span class='hs-conid'>Put</span>
-
-<span class='hs-definition'>get</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>StateT</span> <span class='hs-varid'>s</span> <span class='hs-varid'>m</span> <span class='hs-varid'>s</span>
-<span class='hs-definition'>get</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>singleton</span> <span class='hs-conid'>Get</span>
-
-<span class='hs-definition'>testState</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Int</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>Int</span>
-<span class='hs-definition'>testState</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>evalState</span> <span class='hs-varop'>$</span> <span class='hs-keyword'>do</span>
-        <span class='hs-varid'>x</span> <span class='hs-keyglyph'>&lt;-</span> <span class='hs-varid'>get</span>
-        <span class='hs-varid'>put</span> <span class='hs-layout'>(</span><span class='hs-varid'>x</span><span class='hs-varop'>+</span><span class='hs-num'>2</span><span class='hs-layout'>)</span>
-        <span class='hs-varid'>get</span>
-
-<span class='hs-comment'>{------------------------------------------------------------------------------
-    State Monad Transformer
-------------------------------------------------------------------------------}</span>
-<span class='hs-keyword'>type</span> <span class='hs-conid'>StateT</span> <span class='hs-varid'>s</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>ProgramT</span> <span class='hs-layout'>(</span><span class='hs-conid'>StateI</span> <span class='hs-varid'>s</span><span class='hs-layout'>)</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span>
-
-<span class='hs-definition'>evalStateT</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Monad</span> <span class='hs-varid'>m</span> <span class='hs-keyglyph'>=&gt;</span> <span class='hs-conid'>StateT</span> <span class='hs-varid'>s</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>s</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span>
-<span class='hs-definition'>evalStateT</span> <span class='hs-varid'>m</span> <span class='hs-keyglyph'>=</span> <span class='hs-keyglyph'>\</span><span class='hs-varid'>s</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>viewT</span> <span class='hs-varid'>m</span> <span class='hs-varop'>&gt;&gt;=</span> <span class='hs-keyglyph'>\</span><span class='hs-varid'>p</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>eval</span> <span class='hs-varid'>p</span> <span class='hs-varid'>s</span>
-    <span class='hs-keyword'>where</span>
-    <span class='hs-varid'>eval</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Monad</span> <span class='hs-varid'>m</span> <span class='hs-keyglyph'>=&gt;</span> <span class='hs-conid'>ProgramViewT</span> <span class='hs-layout'>(</span><span class='hs-conid'>StateI</span> <span class='hs-varid'>s</span><span class='hs-layout'>)</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-layout'>(</span><span class='hs-varid'>s</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span>
-    <span class='hs-varid'>eval</span> <span class='hs-layout'>(</span><span class='hs-conid'>Return</span> <span class='hs-varid'>x</span><span class='hs-layout'>)</span>     <span class='hs-keyglyph'>=</span> <span class='hs-keyglyph'>\</span><span class='hs-keyword'>_</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>return</span> <span class='hs-varid'>x</span>
-    <span class='hs-varid'>eval</span> <span class='hs-layout'>(</span><span class='hs-conid'>Get</span>   <span class='hs-conop'>:&gt;&gt;=</span> <span class='hs-varid'>k</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span> <span class='hs-keyglyph'>\</span><span class='hs-varid'>s</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>evalStateT</span> <span class='hs-layout'>(</span><span class='hs-varid'>k</span> <span class='hs-varid'>s</span> <span class='hs-layout'>)</span> <span class='hs-varid'>s</span>
-    <span class='hs-varid'>eval</span> <span class='hs-layout'>(</span><span class='hs-conid'>Put</span> <span class='hs-varid'>s</span> <span class='hs-conop'>:&gt;&gt;=</span> <span class='hs-varid'>k</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span> <span class='hs-keyglyph'>\</span><span class='hs-keyword'>_</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>evalStateT</span> <span class='hs-layout'>(</span><span class='hs-varid'>k</span> <span class='hs-conid'>()</span><span class='hs-layout'>)</span> <span class='hs-varid'>s</span>
-
-<span class='hs-definition'>testStateT</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>evalStateT</span> <span class='hs-varop'>$</span> <span class='hs-keyword'>do</span>
-    <span class='hs-varid'>x</span> <span class='hs-keyglyph'>&lt;-</span> <span class='hs-varid'>get</span>
-    <span class='hs-varid'>lift</span> <span class='hs-varop'>$</span> <span class='hs-varid'>putStrLn</span> <span class='hs-str'>"Hello StateT"</span>
-    <span class='hs-varid'>put</span> <span class='hs-layout'>(</span><span class='hs-varid'>x</span><span class='hs-varop'>+</span><span class='hs-num'>1</span><span class='hs-layout'>)</span>
-</pre></body>
-</html>
diff --git a/docs/web/examples/TicTacToe.hs.html b/docs/web/examples/TicTacToe.hs.html
deleted file mode 100644
--- a/docs/web/examples/TicTacToe.hs.html
+++ /dev/null
@@ -1,186 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html>
-<head>
-<!-- Generated by HsColour, http://www.cs.york.ac.uk/fp/darcs/hscolour/ -->
-<title>examples/TicTacToe.hs</title>
-<link type='text/css' rel='stylesheet' href='hscolour.css' />
-</head>
-<body>
-<pre><span class='hs-comment'>{------------------------------------------------------------------------------
-    Control.Monad.Operational
-    
-    Example:
-    An implementation of the game TicTacToe.
-    
-    Each player (human, AI, ...) is implemented in a separate monad
-    which are then intermingled to run the game. This resembles the
-    PoorMansConcurrency.hs example.
-    
-    
-    Many thanks to Yves Pars and Bertram Felgenhauer
-    <a href="http://www.haskell.org/pipermail/haskell-cafe/2010-April/076216.html">http://www.haskell.org/pipermail/haskell-cafe/2010-April/076216.html</a>
-
-------------------------------------------------------------------------------}</span>
-<span class='hs-comment'>{-# LANGUAGE GADTs, Rank2Types #-}</span>
-<span class='hs-keyword'>module</span> <span class='hs-conid'>TicTacToe</span> <span class='hs-keyword'>where</span>
-
-<span class='hs-keyword'>import</span> <span class='hs-conid'>Control</span><span class='hs-varop'>.</span><span class='hs-conid'>Monad</span>
-<span class='hs-keyword'>import</span> <span class='hs-conid'>Control</span><span class='hs-varop'>.</span><span class='hs-conid'>Monad</span><span class='hs-varop'>.</span><span class='hs-conid'>Operational</span>
-<span class='hs-keyword'>import</span> <span class='hs-conid'>Control</span><span class='hs-varop'>.</span><span class='hs-conid'>Monad</span><span class='hs-varop'>.</span><span class='hs-conid'>State</span>
-
-<span class='hs-keyword'>import</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>Either</span>
-<span class='hs-keyword'>import</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>List</span>
-
-    <span class='hs-comment'>-- external libraries needed</span>
-<span class='hs-keyword'>import</span> <span class='hs-conid'>System</span><span class='hs-varop'>.</span><span class='hs-conid'>Random</span>
-
-<span class='hs-comment'>{------------------------------------------------------------------------------
-    The Player monad for implementing players (human, AI, ...)
-    provides two operations
-    
-        readBoard   -- read the current board position
-        playMove    -- play a move
-
-    to query the current board position and perform a move, respectively.
-    
-    Moreover, it's actually a monad transformer intended to be used over IO.
-    This way, the players can perform IO computations.
-------------------------------------------------------------------------------}</span>
-<span class='hs-keyword'>data</span> <span class='hs-conid'>PlayerI</span> <span class='hs-varid'>a</span> <span class='hs-keyword'>where</span>
-    <span class='hs-conid'>ReadBoard</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>PlayerI</span> <span class='hs-conid'>Board</span>
-    <span class='hs-conid'>PlayMove</span>  <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Int</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>PlayerI</span> <span class='hs-conid'>Bool</span>
-    
-<span class='hs-keyword'>type</span> <span class='hs-conid'>Player</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>ProgramT</span> <span class='hs-conid'>PlayerI</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span>
-
-<span class='hs-definition'>readBoard</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>singleton</span> <span class='hs-conid'>ReadBoard</span>
-<span class='hs-definition'>playMove</span>  <span class='hs-keyglyph'>=</span> <span class='hs-varid'>singleton</span> <span class='hs-varop'>.</span> <span class='hs-conid'>PlayMove</span>
-
-    <span class='hs-comment'>-- interpreter</span>
-<span class='hs-definition'>runGame</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Player</span> <span class='hs-conid'>IO</span> <span class='hs-conid'>()</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>Player</span> <span class='hs-conid'>IO</span> <span class='hs-conid'>()</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>IO</span> <span class='hs-conid'>()</span>
-<span class='hs-definition'>runGame</span> <span class='hs-varid'>player1</span> <span class='hs-varid'>player2</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>eval'</span> <span class='hs-varid'>initialGameState</span> <span class='hs-varid'>player1</span> <span class='hs-varid'>player2</span>
-    <span class='hs-keyword'>where</span>
-    <span class='hs-varid'>eval'</span> <span class='hs-varid'>game</span> <span class='hs-varid'>p1</span> <span class='hs-varid'>p2</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>viewT</span> <span class='hs-varid'>p1</span> <span class='hs-varop'>&gt;&gt;=</span> <span class='hs-keyglyph'>\</span><span class='hs-varid'>p1view</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>eval</span> <span class='hs-varid'>game</span> <span class='hs-varid'>p1view</span> <span class='hs-varid'>p2</span>
-    
-    <span class='hs-varid'>eval</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>GameState</span>
-         <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>ProgramViewT</span> <span class='hs-conid'>PlayerI</span> <span class='hs-conid'>IO</span> <span class='hs-conid'>()</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>Player</span> <span class='hs-conid'>IO</span> <span class='hs-conid'>()</span>
-         <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>IO</span> <span class='hs-conid'>()</span>
-    <span class='hs-varid'>eval</span> <span class='hs-varid'>game</span> <span class='hs-layout'>(</span><span class='hs-conid'>Return</span> <span class='hs-keyword'>_</span><span class='hs-layout'>)</span>            <span class='hs-keyword'>_</span>  <span class='hs-keyglyph'>=</span> <span class='hs-varid'>return</span> <span class='hs-conid'>()</span>
-    <span class='hs-varid'>eval</span> <span class='hs-varid'>game</span> <span class='hs-layout'>(</span><span class='hs-conid'>ReadBoard</span>   <span class='hs-conop'>:&gt;&gt;=</span> <span class='hs-varid'>p1</span><span class='hs-layout'>)</span> <span class='hs-varid'>p2</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>eval'</span> <span class='hs-varid'>game</span> <span class='hs-layout'>(</span><span class='hs-varid'>p1</span> <span class='hs-layout'>(</span><span class='hs-varid'>board</span> <span class='hs-varid'>game</span><span class='hs-layout'>)</span><span class='hs-layout'>)</span> <span class='hs-varid'>p2</span>
-    <span class='hs-varid'>eval</span> <span class='hs-varid'>game</span> <span class='hs-layout'>(</span><span class='hs-conid'>PlayMove</span> <span class='hs-varid'>mv</span> <span class='hs-conop'>:&gt;&gt;=</span> <span class='hs-varid'>p1</span><span class='hs-layout'>)</span> <span class='hs-varid'>p2</span> <span class='hs-keyglyph'>=</span>
-        <span class='hs-keyword'>case</span> <span class='hs-varid'>makeMove</span> <span class='hs-varid'>mv</span> <span class='hs-varid'>game</span> <span class='hs-keyword'>of</span>
-            <span class='hs-conid'>Nothing</span>         <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>eval'</span> <span class='hs-varid'>game</span> <span class='hs-layout'>(</span><span class='hs-varid'>p1</span> <span class='hs-conid'>False</span><span class='hs-layout'>)</span> <span class='hs-varid'>p2</span>
-            <span class='hs-conid'>Just</span> <span class='hs-varid'>game'</span>
-                <span class='hs-keyglyph'>|</span> <span class='hs-varid'>won</span> <span class='hs-varid'>game'</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-keyword'>let</span> <span class='hs-varid'>p</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>activePlayer</span> <span class='hs-varid'>game</span> <span class='hs-keyword'>in</span>
-                               <span class='hs-varid'>putStrLn</span> <span class='hs-varop'>$</span> <span class='hs-str'>"Player "</span> <span class='hs-varop'>++</span> <span class='hs-varid'>show</span> <span class='hs-varid'>p</span> <span class='hs-varop'>++</span> <span class='hs-str'>" has won!"</span>
-                <span class='hs-keyglyph'>|</span> <span class='hs-varid'>draw</span> <span class='hs-varid'>game'</span><span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>putStrLn</span> <span class='hs-varop'>$</span> <span class='hs-str'>"It's a draw."</span>
-                <span class='hs-keyglyph'>|</span> <span class='hs-varid'>otherwise</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>eval'</span> <span class='hs-varid'>game'</span> <span class='hs-varid'>p2</span> <span class='hs-layout'>(</span><span class='hs-varid'>p1</span> <span class='hs-conid'>True</span><span class='hs-layout'>)</span>
-    
-    <span class='hs-comment'>-- example: human vs AI</span>
-<span class='hs-definition'>main</span> <span class='hs-keyglyph'>=</span> <span class='hs-keyword'>do</span>
-    <span class='hs-varid'>g</span> <span class='hs-keyglyph'>&lt;-</span> <span class='hs-varid'>getStdGen</span>
-    <span class='hs-varid'>runGame</span> <span class='hs-varid'>playerHuman</span> <span class='hs-layout'>(</span><span class='hs-varid'>playerAI</span> <span class='hs-varid'>g</span><span class='hs-layout'>)</span>
-
-<span class='hs-comment'>{------------------------------------------------------------------------------
-    TicTacToe Board type and logic
-    
-    The board looks like this:
-    
-    +---+---+---+   some squares already played on
-    | 1 | 2 | 3 |   the empty squares are numbered
-    +---+---+---+
-    | 4 | 5 |OOO|
-    +---+---+---+
-    | 7 |XXX| 9 |
-    +---+---+---+
-------------------------------------------------------------------------------}</span>
-<span class='hs-keyword'>data</span> <span class='hs-conid'>Symbol</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>X</span> <span class='hs-keyglyph'>|</span> <span class='hs-conid'>O</span> <span class='hs-keyword'>deriving</span> <span class='hs-layout'>(</span><span class='hs-conid'>Eq</span><span class='hs-layout'>,</span><span class='hs-conid'>Show</span><span class='hs-layout'>)</span>
-<span class='hs-keyword'>type</span> <span class='hs-conid'>Square</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Either</span> <span class='hs-conid'>Int</span> <span class='hs-conid'>Symbol</span>
-<span class='hs-keyword'>type</span> <span class='hs-conid'>Board</span> <span class='hs-keyglyph'>=</span> <span class='hs-keyglyph'>[</span><span class='hs-keyglyph'>[</span><span class='hs-conid'>Square</span><span class='hs-keyglyph'>]</span><span class='hs-keyglyph'>]</span>
-<span class='hs-keyword'>data</span> <span class='hs-conid'>GameState</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Game</span> <span class='hs-layout'>{</span> <span class='hs-varid'>board</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Board</span><span class='hs-layout'>,</span> <span class='hs-varid'>activePlayer</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Symbol</span> <span class='hs-layout'>}</span>
-
-<span class='hs-definition'>initialGameState</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>GameState</span>
-<span class='hs-definition'>initialGameState</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Game</span> <span class='hs-layout'>(</span><span class='hs-varid'>map</span> <span class='hs-layout'>(</span><span class='hs-varid'>map</span> <span class='hs-conid'>Left</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>[</span><span class='hs-keyglyph'>[</span><span class='hs-num'>1</span><span class='hs-layout'>,</span><span class='hs-num'>2</span><span class='hs-layout'>,</span><span class='hs-num'>3</span><span class='hs-keyglyph'>]</span><span class='hs-layout'>,</span><span class='hs-keyglyph'>[</span><span class='hs-num'>4</span><span class='hs-layout'>,</span><span class='hs-num'>5</span><span class='hs-layout'>,</span><span class='hs-num'>6</span><span class='hs-keyglyph'>]</span><span class='hs-layout'>,</span><span class='hs-keyglyph'>[</span><span class='hs-num'>7</span><span class='hs-layout'>,</span><span class='hs-num'>8</span><span class='hs-layout'>,</span><span class='hs-num'>9</span><span class='hs-keyglyph'>]</span><span class='hs-keyglyph'>]</span><span class='hs-layout'>)</span> <span class='hs-conid'>X</span>
-
-    <span class='hs-comment'>-- list the possible moves to play</span>
-<span class='hs-definition'>possibleMoves</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Board</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-keyglyph'>[</span><span class='hs-conid'>Int</span><span class='hs-keyglyph'>]</span>
-<span class='hs-definition'>possibleMoves</span> <span class='hs-varid'>board</span> <span class='hs-keyglyph'>=</span> <span class='hs-keyglyph'>[</span><span class='hs-varid'>k</span> <span class='hs-keyglyph'>|</span> <span class='hs-conid'>Left</span> <span class='hs-varid'>k</span> <span class='hs-keyglyph'>&lt;-</span> <span class='hs-varid'>concat</span> <span class='hs-varid'>board</span><span class='hs-keyglyph'>]</span>
-
-    <span class='hs-comment'>-- play a stone at a square</span>
-<span class='hs-definition'>makeMove</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Int</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>GameState</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>Maybe</span> <span class='hs-conid'>GameState</span>
-<span class='hs-definition'>makeMove</span> <span class='hs-varid'>k</span> <span class='hs-layout'>(</span><span class='hs-conid'>Game</span> <span class='hs-varid'>board</span> <span class='hs-varid'>player</span><span class='hs-layout'>)</span>
-    <span class='hs-keyglyph'>|</span> <span class='hs-varid'>not</span> <span class='hs-layout'>(</span><span class='hs-varid'>k</span> <span class='hs-varop'>`elem`</span> <span class='hs-varid'>possibleMoves</span> <span class='hs-varid'>board</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Nothing</span>   <span class='hs-comment'>-- illegal move</span>
-    <span class='hs-keyglyph'>|</span> <span class='hs-varid'>otherwise</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Just</span> <span class='hs-varop'>$</span> <span class='hs-conid'>Game</span> <span class='hs-layout'>(</span><span class='hs-varid'>map</span> <span class='hs-layout'>(</span><span class='hs-varid'>map</span> <span class='hs-varid'>replace</span><span class='hs-layout'>)</span> <span class='hs-varid'>board</span><span class='hs-layout'>)</span> <span class='hs-layout'>(</span><span class='hs-varid'>switch</span> <span class='hs-varid'>player</span><span class='hs-layout'>)</span>
-    <span class='hs-keyword'>where</span>
-    <span class='hs-varid'>replace</span> <span class='hs-layout'>(</span><span class='hs-conid'>Left</span> <span class='hs-varid'>k'</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>|</span> <span class='hs-varid'>k'</span> <span class='hs-varop'>==</span> <span class='hs-varid'>k</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Right</span> <span class='hs-varid'>player</span>
-    <span class='hs-varid'>replace</span> <span class='hs-varid'>x</span>                   <span class='hs-keyglyph'>=</span> <span class='hs-varid'>x</span>
-
-    <span class='hs-varid'>switch</span> <span class='hs-conid'>X</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>O</span>
-    <span class='hs-varid'>switch</span> <span class='hs-conid'>O</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>X</span>
-
-    <span class='hs-comment'>-- has somebody won the game?</span>
-<span class='hs-definition'>won</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>GameState</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>Bool</span>
-<span class='hs-definition'>won</span> <span class='hs-layout'>(</span><span class='hs-conid'>Game</span> <span class='hs-varid'>board</span> <span class='hs-keyword'>_</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>any</span> <span class='hs-varid'>full</span> <span class='hs-varop'>$</span> <span class='hs-varid'>diagonals</span> <span class='hs-varid'>board</span> <span class='hs-varop'>++</span> <span class='hs-varid'>rows</span> <span class='hs-varid'>board</span> <span class='hs-varop'>++</span> <span class='hs-varid'>cols</span> <span class='hs-varid'>board</span>
-    <span class='hs-keyword'>where</span>
-    <span class='hs-varid'>full</span> <span class='hs-keyglyph'>[</span><span class='hs-varid'>a</span><span class='hs-layout'>,</span><span class='hs-varid'>b</span><span class='hs-layout'>,</span><span class='hs-varid'>c</span><span class='hs-keyglyph'>]</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>a</span> <span class='hs-varop'>==</span> <span class='hs-varid'>b</span> <span class='hs-varop'>&amp;&amp;</span> <span class='hs-varid'>b</span> <span class='hs-varop'>==</span> <span class='hs-varid'>c</span>
-    <span class='hs-varid'>diagonals</span> <span class='hs-keyglyph'>[</span><span class='hs-keyglyph'>[</span><span class='hs-varid'>a1</span><span class='hs-layout'>,</span><span class='hs-keyword'>_</span><span class='hs-layout'>,</span><span class='hs-varid'>b1</span><span class='hs-keyglyph'>]</span><span class='hs-layout'>,</span>
-               <span class='hs-keyglyph'>[</span><span class='hs-keyword'>_</span> <span class='hs-layout'>,</span><span class='hs-varid'>c</span><span class='hs-layout'>,</span><span class='hs-keyword'>_</span> <span class='hs-keyglyph'>]</span><span class='hs-layout'>,</span>
-               <span class='hs-keyglyph'>[</span><span class='hs-varid'>b2</span><span class='hs-layout'>,</span><span class='hs-keyword'>_</span><span class='hs-layout'>,</span><span class='hs-varid'>a2</span><span class='hs-keyglyph'>]</span><span class='hs-keyglyph'>]</span> <span class='hs-keyglyph'>=</span> <span class='hs-keyglyph'>[</span><span class='hs-keyglyph'>[</span><span class='hs-varid'>a1</span><span class='hs-layout'>,</span><span class='hs-varid'>c</span><span class='hs-layout'>,</span><span class='hs-varid'>a2</span><span class='hs-keyglyph'>]</span><span class='hs-layout'>,</span><span class='hs-keyglyph'>[</span><span class='hs-varid'>b1</span><span class='hs-layout'>,</span><span class='hs-varid'>c</span><span class='hs-layout'>,</span><span class='hs-varid'>b2</span><span class='hs-keyglyph'>]</span><span class='hs-keyglyph'>]</span>
-    <span class='hs-varid'>rows</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>id</span>
-    <span class='hs-varid'>cols</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>transpose</span>
-
-    <span class='hs-comment'>-- is the game a draw?</span>
-<span class='hs-definition'>draw</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>GameState</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>Bool</span>
-<span class='hs-definition'>draw</span> <span class='hs-layout'>(</span><span class='hs-conid'>Game</span> <span class='hs-varid'>board</span> <span class='hs-keyword'>_</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>null</span> <span class='hs-layout'>(</span><span class='hs-varid'>possibleMoves</span> <span class='hs-varid'>board</span><span class='hs-layout'>)</span>
-
-    <span class='hs-comment'>-- print the board</span>
-<span class='hs-definition'>showSquare</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>either</span> <span class='hs-layout'>(</span><span class='hs-keyglyph'>\</span><span class='hs-varid'>n</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-str'>" "</span> <span class='hs-varop'>++</span> <span class='hs-varid'>show</span> <span class='hs-varid'>n</span> <span class='hs-varop'>++</span> <span class='hs-str'>" "</span><span class='hs-layout'>)</span> <span class='hs-layout'>(</span><span class='hs-varid'>concat</span> <span class='hs-varop'>.</span> <span class='hs-varid'>replicate</span> <span class='hs-num'>3</span> <span class='hs-varop'>.</span> <span class='hs-varid'>show</span><span class='hs-layout'>)</span>
-
-<span class='hs-definition'>showBoard</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Board</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>String</span>
-<span class='hs-definition'>showBoard</span> <span class='hs-varid'>board</span> <span class='hs-keyglyph'>=</span>
-      <span class='hs-varid'>unlines</span> <span class='hs-varop'>.</span> <span class='hs-varid'>surround</span> <span class='hs-str'>"+---+---+---+"</span>
-    <span class='hs-varop'>.</span> <span class='hs-varid'>map</span> <span class='hs-layout'>(</span><span class='hs-varid'>concat</span> <span class='hs-varop'>.</span> <span class='hs-varid'>surround</span> <span class='hs-str'>"|"</span><span class='hs-varop'>.</span> <span class='hs-varid'>map</span> <span class='hs-varid'>showSquare</span><span class='hs-layout'>)</span>
-    <span class='hs-varop'>$</span> <span class='hs-varid'>board</span>
-    <span class='hs-keyword'>where</span>
-    <span class='hs-varid'>surround</span> <span class='hs-varid'>x</span> <span class='hs-varid'>xs</span> <span class='hs-keyglyph'>=</span> <span class='hs-keyglyph'>[</span><span class='hs-varid'>x</span><span class='hs-keyglyph'>]</span> <span class='hs-varop'>++</span> <span class='hs-varid'>intersperse</span> <span class='hs-varid'>x</span> <span class='hs-varid'>xs</span> <span class='hs-varop'>++</span> <span class='hs-keyglyph'>[</span><span class='hs-varid'>x</span><span class='hs-keyglyph'>]</span>
-
-<span class='hs-definition'>printBoard</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>putStr</span> <span class='hs-varop'>.</span> <span class='hs-varid'>showBoard</span>
-
-<span class='hs-comment'>{------------------------------------------------------------------------------
-    Player examples
-------------------------------------------------------------------------------}</span>
-    <span class='hs-comment'>-- a human player on the command line</span>
-<span class='hs-definition'>playerHuman</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Player</span> <span class='hs-conid'>IO</span> <span class='hs-conid'>()</span>
-<span class='hs-definition'>playerHuman</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>forever</span> <span class='hs-varop'>$</span> <span class='hs-varid'>readBoard</span> <span class='hs-varop'>&gt;&gt;=</span> <span class='hs-varid'>liftIO</span> <span class='hs-varop'>.</span> <span class='hs-varid'>printBoard</span> <span class='hs-varop'>&gt;&gt;</span> <span class='hs-varid'>doMove</span>
-    <span class='hs-keyword'>where</span>
-    <span class='hs-comment'>-- ask the player where to move</span>
-    <span class='hs-varid'>doMove</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Player</span> <span class='hs-conid'>IO</span> <span class='hs-conid'>()</span>
-    <span class='hs-varid'>doMove</span> <span class='hs-keyglyph'>=</span> <span class='hs-keyword'>do</span>
-        <span class='hs-varid'>liftIO</span> <span class='hs-varop'>.</span> <span class='hs-varid'>putStrLn</span> <span class='hs-varop'>$</span> <span class='hs-str'>"At which number would you like to play?"</span>
-        <span class='hs-varid'>n</span> <span class='hs-keyglyph'>&lt;-</span> <span class='hs-varid'>liftIO</span> <span class='hs-varid'>getLine</span>
-        <span class='hs-varid'>b</span> <span class='hs-keyglyph'>&lt;-</span> <span class='hs-varid'>playMove</span> <span class='hs-layout'>(</span><span class='hs-varid'>read</span> <span class='hs-varid'>n</span><span class='hs-layout'>)</span>
-        <span class='hs-varid'>unless</span> <span class='hs-varid'>b</span> <span class='hs-varop'>$</span> <span class='hs-keyword'>do</span>
-            <span class='hs-varid'>liftIO</span> <span class='hs-varop'>.</span> <span class='hs-varid'>putStrLn</span> <span class='hs-varop'>$</span> <span class='hs-str'>"Position "</span> <span class='hs-varop'>++</span> <span class='hs-varid'>show</span> <span class='hs-varid'>n</span> <span class='hs-varop'>++</span> <span class='hs-str'>" is already full."</span>
-            <span class='hs-varid'>doMove</span>
-
-    <span class='hs-comment'>-- a random AI,</span>
-    <span class='hs-comment'>-- also demonstrates how to use a custom StateT on top</span>
-    <span class='hs-comment'>--   of the Player monad</span>
-<span class='hs-definition'>playerAI</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Monad</span> <span class='hs-varid'>m</span> <span class='hs-keyglyph'>=&gt;</span> <span class='hs-conid'>StdGen</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>Player</span> <span class='hs-varid'>m</span> <span class='hs-conid'>()</span>
-<span class='hs-definition'>playerAI</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>evalStateT</span> <span class='hs-varid'>ai</span>
-    <span class='hs-keyword'>where</span>
-    <span class='hs-varid'>ai</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Monad</span> <span class='hs-varid'>m</span> <span class='hs-keyglyph'>=&gt;</span> <span class='hs-conid'>StateT</span> <span class='hs-conid'>StdGen</span> <span class='hs-layout'>(</span><span class='hs-conid'>ProgramT</span> <span class='hs-conid'>PlayerI</span> <span class='hs-varid'>m</span><span class='hs-layout'>)</span> <span class='hs-conid'>()</span>
-    <span class='hs-varid'>ai</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>forever</span> <span class='hs-varop'>$</span> <span class='hs-keyword'>do</span>
-        <span class='hs-varid'>board</span> <span class='hs-keyglyph'>&lt;-</span> <span class='hs-varid'>lift</span> <span class='hs-varop'>$</span> <span class='hs-varid'>readBoard</span>
-        <span class='hs-varid'>n</span>     <span class='hs-keyglyph'>&lt;-</span> <span class='hs-varid'>uniform</span> <span class='hs-layout'>(</span><span class='hs-varid'>possibleMoves</span> <span class='hs-varid'>board</span><span class='hs-layout'>)</span> <span class='hs-comment'>-- select a random move</span>
-        <span class='hs-varid'>lift</span> <span class='hs-varop'>$</span> <span class='hs-varid'>playMove</span> <span class='hs-varid'>n</span>
-        <span class='hs-keyword'>where</span>
-        <span class='hs-comment'>-- select one element at random</span>
-        <span class='hs-varid'>uniform</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Monad</span> <span class='hs-varid'>m</span> <span class='hs-keyglyph'>=&gt;</span> <span class='hs-keyglyph'>[</span><span class='hs-varid'>a</span><span class='hs-keyglyph'>]</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>StateT</span> <span class='hs-conid'>StdGen</span> <span class='hs-varid'>m</span> <span class='hs-varid'>a</span>
-        <span class='hs-varid'>uniform</span> <span class='hs-varid'>xs</span> <span class='hs-keyglyph'>=</span> <span class='hs-keyword'>do</span>
-            <span class='hs-varid'>gen</span> <span class='hs-keyglyph'>&lt;-</span> <span class='hs-varid'>get</span>
-            <span class='hs-keyword'>let</span> <span class='hs-layout'>(</span><span class='hs-varid'>n</span><span class='hs-layout'>,</span><span class='hs-varid'>gen'</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>randomR</span> <span class='hs-layout'>(</span><span class='hs-num'>1</span><span class='hs-layout'>,</span><span class='hs-varid'>length</span> <span class='hs-varid'>xs</span><span class='hs-layout'>)</span> <span class='hs-varid'>gen</span>
-            <span class='hs-varid'>put</span> <span class='hs-varid'>gen'</span>
-            <span class='hs-varid'>return</span> <span class='hs-layout'>(</span><span class='hs-varid'>xs</span> <span class='hs-varop'>!!</span> <span class='hs-layout'>(</span><span class='hs-varid'>n</span><span class='hs-comment'>-</span><span class='hs-num'>1</span><span class='hs-layout'>)</span><span class='hs-layout'>)</span>
-
-</pre></body>
-</html>
diff --git a/docs/web/examples/WebSessionState.lhs.html b/docs/web/examples/WebSessionState.lhs.html
deleted file mode 100644
--- a/docs/web/examples/WebSessionState.lhs.html
+++ /dev/null
@@ -1,112 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html>
-<head>
-<!-- Generated by HsColour, http://www.cs.york.ac.uk/fp/darcs/hscolour/ -->
-<title>examples/WebSessionState.lhs</title>
-<link type='text/css' rel='stylesheet' href='hscolour.css' />
-</head>
-<body>
-#!/bin/sh runghc
-\begin{code}
-<pre><span class='hs-comment'>{------------------------------------------------------------------------------
-    Control.Monad.Operational
-    
-    Example:
-    A CGI script that maintains session state
-    <a href="http://www.informatik.uni-freiburg.de/~thiemann/WASH/draft.pdf">http://www.informatik.uni-freiburg.de/~thiemann/WASH/draft.pdf</a>
-
-------------------------------------------------------------------------------}</span>
-<span class='hs-comment'>{-# LANGUAGE GADTs, Rank2Types #-}</span>
-<span class='hs-keyword'>module</span> <span class='hs-conid'>WebSessionState</span> <span class='hs-keyword'>where</span>
-
-<span class='hs-keyword'>import</span> <span class='hs-conid'>Control</span><span class='hs-varop'>.</span><span class='hs-conid'>Monad</span>
-<span class='hs-keyword'>import</span> <span class='hs-conid'>Control</span><span class='hs-varop'>.</span><span class='hs-conid'>Monad</span><span class='hs-varop'>.</span><span class='hs-conid'>Operational</span>
-<span class='hs-keyword'>import</span> <span class='hs-conid'>Control</span><span class='hs-varop'>.</span><span class='hs-conid'>Monad</span><span class='hs-varop'>.</span><span class='hs-conid'>Trans</span> <span class='hs-varid'>hiding</span> <span class='hs-layout'>(</span><span class='hs-varid'>lift</span><span class='hs-layout'>)</span>
-
-<span class='hs-keyword'>import</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>Char</span>
-<span class='hs-keyword'>import</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>Maybe</span>
-
-    <span class='hs-comment'>-- external libraries needed</span>
-<span class='hs-keyword'>import</span> <span class='hs-conid'>Text</span><span class='hs-varop'>.</span><span class='hs-conid'>Html</span> <span class='hs-keyword'>as</span> <span class='hs-conid'>H</span>
-<span class='hs-keyword'>import</span> <span class='hs-conid'>Network</span><span class='hs-varop'>.</span><span class='hs-conid'>CGI</span>
-
-<span class='hs-comment'>{------------------------------------------------------------------------------
-    This example shows a "magic" implementation of a web session that
-    looks like it needs to be executed in a running process,
-    while in fact it's just a CGI script.
-    
-    The key part is a monad, called "Web" for lack of imagination,
-    which supports a single operation
-    
-        ask :: String -&gt; Web String
-    
-    which sends a simple minded HTML-Form to the web user
-    and returns his answer.
-    
-    How does this work? The trick is that all previous answers
-    are logged in a hidden field of the input form.
-    The CGI script will simply replays this log when called.
-    In other words, the user state is stored in the input form.
-
-------------------------------------------------------------------------------}</span>
-<span class='hs-keyword'>data</span> <span class='hs-conid'>WebI</span> <span class='hs-varid'>a</span> <span class='hs-keyword'>where</span>
-    <span class='hs-conid'>Ask</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>String</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>WebI</span> <span class='hs-conid'>String</span>
-
-<span class='hs-keyword'>type</span> <span class='hs-conid'>Web</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Program</span> <span class='hs-conid'>WebI</span> <span class='hs-varid'>a</span>
-
-<span class='hs-definition'>ask</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>singleton</span> <span class='hs-varop'>.</span> <span class='hs-conid'>Ask</span>
-
-    <span class='hs-comment'>-- interpreter</span>
-<span class='hs-definition'>runWeb</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Web</span> <span class='hs-conid'>H</span><span class='hs-varop'>.</span><span class='hs-conid'>Html</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>CGI</span> <span class='hs-conid'>CGIResult</span>
-<span class='hs-definition'>runWeb</span> <span class='hs-varid'>m</span> <span class='hs-keyglyph'>=</span> <span class='hs-keyword'>do</span>
-            <span class='hs-comment'>-- fetch log</span>
-        <span class='hs-varid'>log'</span> <span class='hs-keyglyph'>&lt;-</span> <span class='hs-varid'>maybe</span> <span class='hs-conid'>[]</span> <span class='hs-layout'>(</span><span class='hs-varid'>read</span> <span class='hs-varop'>.</span> <span class='hs-varid'>urlDecode</span><span class='hs-layout'>)</span> <span class='hs-varop'>`liftM`</span> <span class='hs-varid'>getInput</span> <span class='hs-str'>"log"</span>
-            <span class='hs-comment'>-- maybe append form input</span>
-        <span class='hs-varid'>f</span>    <span class='hs-keyglyph'>&lt;-</span> <span class='hs-varid'>maybe</span> <span class='hs-varid'>id</span> <span class='hs-layout'>(</span><span class='hs-keyglyph'>\</span><span class='hs-varid'>answer</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-layout'>(</span><span class='hs-varop'>++</span> <span class='hs-keyglyph'>[</span><span class='hs-varid'>answer</span><span class='hs-keyglyph'>]</span><span class='hs-layout'>)</span><span class='hs-layout'>)</span> <span class='hs-varop'>`liftM`</span> <span class='hs-varid'>getInput</span> <span class='hs-str'>"answer"</span>
-        <span class='hs-keyword'>let</span> <span class='hs-varid'>log</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>f</span> <span class='hs-varid'>log'</span>
-            <span class='hs-comment'>-- run Web action and output result</span>
-        <span class='hs-varid'>output</span> <span class='hs-varop'>.</span> <span class='hs-varid'>renderHtml</span> <span class='hs-varop'>=&lt;&lt;</span> <span class='hs-varid'>replay</span> <span class='hs-varid'>m</span> <span class='hs-varid'>log</span> <span class='hs-varid'>log</span>
-    <span class='hs-keyword'>where</span>
-    <span class='hs-varid'>replay</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>eval</span> <span class='hs-varop'>.</span> <span class='hs-varid'>view</span>
-    
-    <span class='hs-varid'>eval</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>ProgramView</span> <span class='hs-conid'>WebI</span> <span class='hs-conid'>H</span><span class='hs-varop'>.</span><span class='hs-conid'>Html</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-keyglyph'>[</span><span class='hs-conid'>String</span><span class='hs-keyglyph'>]</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-keyglyph'>[</span><span class='hs-conid'>String</span><span class='hs-keyglyph'>]</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>CGI</span> <span class='hs-conid'>H</span><span class='hs-varop'>.</span><span class='hs-conid'>Html</span>
-    <span class='hs-varid'>eval</span> <span class='hs-layout'>(</span><span class='hs-conid'>Return</span> <span class='hs-varid'>html</span><span class='hs-layout'>)</span>         <span class='hs-varid'>log</span> <span class='hs-keyword'>_</span>      <span class='hs-keyglyph'>=</span> <span class='hs-varid'>return</span> <span class='hs-varid'>html</span>
-    <span class='hs-varid'>eval</span> <span class='hs-layout'>(</span><span class='hs-conid'>Ask</span> <span class='hs-varid'>question</span> <span class='hs-conop'>:&gt;&gt;=</span> <span class='hs-varid'>k</span><span class='hs-layout'>)</span> <span class='hs-varid'>log</span> <span class='hs-layout'>(</span><span class='hs-varid'>l</span><span class='hs-conop'>:</span><span class='hs-varid'>ls</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span> <span class='hs-comment'>-- replay answer from log</span>
-        <span class='hs-varid'>replay</span> <span class='hs-layout'>(</span><span class='hs-varid'>k</span> <span class='hs-varid'>l</span><span class='hs-layout'>)</span> <span class='hs-varid'>log</span> <span class='hs-varid'>ls</span>
-    <span class='hs-varid'>eval</span> <span class='hs-layout'>(</span><span class='hs-conid'>Ask</span> <span class='hs-varid'>question</span> <span class='hs-conop'>:&gt;&gt;=</span> <span class='hs-varid'>k</span><span class='hs-layout'>)</span> <span class='hs-varid'>log</span> <span class='hs-conid'>[]</span>     <span class='hs-keyglyph'>=</span> <span class='hs-comment'>-- present HTML page to user</span>
-        <span class='hs-varid'>return</span> <span class='hs-varop'>$</span> <span class='hs-varid'>htmlQuestion</span> <span class='hs-varid'>log</span> <span class='hs-varid'>question</span>
-
-
-    <span class='hs-comment'>-- HTML page with a single form</span>
-<span class='hs-definition'>htmlQuestion</span> <span class='hs-varid'>log</span> <span class='hs-varid'>question</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>htmlEnvelope</span> <span class='hs-varop'>$</span> <span class='hs-varid'>p</span> <span class='hs-varop'>&lt;&lt;</span> <span class='hs-varid'>question</span> <span class='hs-varop'>+++</span> <span class='hs-varid'>x</span>
-    <span class='hs-keyword'>where</span>
-    <span class='hs-varid'>x</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>form</span> <span class='hs-varop'>!</span> <span class='hs-keyglyph'>[</span><span class='hs-varid'>method</span> <span class='hs-str'>"post"</span><span class='hs-keyglyph'>]</span> <span class='hs-varop'>&lt;&lt;</span> <span class='hs-layout'>(</span><span class='hs-varid'>textfield</span> <span class='hs-str'>"answer"</span>
-                <span class='hs-varop'>+++</span> <span class='hs-varid'>submit</span> <span class='hs-str'>"Next"</span> <span class='hs-str'>""</span>
-                <span class='hs-varop'>+++</span> <span class='hs-varid'>hidden</span> <span class='hs-str'>"log"</span> <span class='hs-layout'>(</span><span class='hs-varid'>urlEncode</span> <span class='hs-varop'>$</span> <span class='hs-varid'>show</span> <span class='hs-varid'>log</span><span class='hs-layout'>)</span><span class='hs-layout'>)</span>
-
-<span class='hs-definition'>htmlMessage</span> <span class='hs-varid'>s</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>htmlEnvelope</span> <span class='hs-varop'>$</span> <span class='hs-varid'>p</span> <span class='hs-varop'>&lt;&lt;</span> <span class='hs-varid'>s</span>
-
-<span class='hs-definition'>htmlEnvelope</span> <span class='hs-varid'>html</span> <span class='hs-keyglyph'>=</span>
-    <span class='hs-varid'>header</span> <span class='hs-varop'>&lt;&lt;</span> <span class='hs-varid'>thetitle</span> <span class='hs-varop'>&lt;&lt;</span> <span class='hs-str'>"Web Session State demo"</span>
-    <span class='hs-varop'>+++</span> <span class='hs-varid'>body</span> <span class='hs-varop'>&lt;&lt;</span> <span class='hs-varid'>html</span>
-
-
-    <span class='hs-comment'>-- example</span>
-<span class='hs-definition'>example</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Web</span> <span class='hs-conid'>H</span><span class='hs-varop'>.</span><span class='hs-conid'>Html</span>
-<span class='hs-definition'>example</span> <span class='hs-keyglyph'>=</span> <span class='hs-keyword'>do</span>
-    <span class='hs-varid'>haskell</span> <span class='hs-keyglyph'>&lt;-</span> <span class='hs-varid'>ask</span> <span class='hs-str'>"What's your favorite programming language?"</span>
-    <span class='hs-keyword'>if</span> <span class='hs-varid'>map</span> <span class='hs-varid'>toLower</span> <span class='hs-varid'>haskell</span> <span class='hs-varop'>/=</span> <span class='hs-str'>"haskell"</span>
-        <span class='hs-keyword'>then</span> <span class='hs-varid'>message</span> <span class='hs-str'>"Awww."</span>
-        <span class='hs-keyword'>else</span> <span class='hs-keyword'>do</span>
-            <span class='hs-varid'>ghc</span> <span class='hs-keyglyph'>&lt;-</span> <span class='hs-varid'>ask</span> <span class='hs-str'>"What's your favorite compiler?"</span>
-            <span class='hs-varid'>web</span> <span class='hs-keyglyph'>&lt;-</span> <span class='hs-varid'>ask</span> <span class='hs-str'>"What's your favorite monad?"</span>
-            <span class='hs-varid'>message</span> <span class='hs-varop'>$</span> <span class='hs-str'>"I like "</span> <span class='hs-varop'>++</span> <span class='hs-varid'>ghc</span> <span class='hs-varop'>++</span> <span class='hs-str'>" too, but "</span>
-                      <span class='hs-varop'>++</span> <span class='hs-varid'>web</span> <span class='hs-varop'>++</span> <span class='hs-str'>" is debatable."</span>
-    <span class='hs-keyword'>where</span>
-    <span class='hs-varid'>message</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>return</span> <span class='hs-varop'>.</span> <span class='hs-varid'>htmlMessage</span>
-
-<span class='hs-definition'>main</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>runCGI</span> <span class='hs-varop'>.</span> <span class='hs-varid'>runWeb</span> <span class='hs-varop'>$</span> <span class='hs-varid'>example</span>
-
-</pre>\end{code}
-</body>
-</html>
diff --git a/docs/web/examples/hscolour.css b/docs/web/examples/hscolour.css
deleted file mode 100644
--- a/docs/web/examples/hscolour.css
+++ /dev/null
@@ -1,5 +0,0 @@
-.hs-keyglyph, .hs-layout { color: red; }
-.hs-keyword { color: blue; }
-.hs-comment, .hs-comment a { color: green; }
-.hs-str, .hs-chr { color: teal; }
-.hs-keyword,.hs-conid, .hs-varid, .hs-conop, .hs-varop, .hs-num, .hs-cpp, .hs-sel, .hs-definition {}
diff --git a/docs/web/fptools.css b/docs/web/fptools.css
deleted file mode 100644
--- a/docs/web/fptools.css
+++ /dev/null
@@ -1,48 +0,0 @@
-body {
-    font-family: Verdana, sans-serif;
-    width: 43em;
-    margin: 1ex 3em 1ex;
-}
-
-div {
-  font-family: sans-serif;
-  color: black;
-  background: white
-}
-
-h1, h2, h3, h4, h5, h6, p.title, h1 > a:visited, h2 > a:visited, h1 > a:link, h2 > a:link { color: #005A9C; text-decoration:none; }
-
-h1 { font:            170% sans-serif; }
-h2 { font:            140% sans-serif; }
-h3 { font:            120% sans-serif; }
-h4 { font: bold       100% sans-serif; }
-h5 { font: italic     100% sans-serif; }
-h6 { font: small-caps 100% sans-serif; }
-
-pre {
-  font-family: monospace;
-  border-width: 1px;
-  border-style: solid;
-  padding: 0.3em;
-  color: maroon;
-}
-
-pre.screen         { color: #006400; }
-pre.programlisting { color: maroon; }
-
-div.example {
-  margin: 1ex 0em;
-  border: solid #412e25 1px;
-  padding: 0ex 0.4em;
-}
-
-div.example, div.example-contents {
-  background-color: #fffcf5;
-}
-
-a:link    { color:      #0000C8; }
-a:hover   { background: #FFFFA8; }
-a:active  { color:      #D00000; }
-a:visited { color:      #680098; }
-
-h1 > a { color: #000; }
diff --git a/docs/web/index.html b/docs/web/index.html
deleted file mode 100644
--- a/docs/web/index.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<html><head><title>The 'operational' package</title></head>
-<body>
-<h1>The 'operational' package</h1>
-
-Implement monads by specifying instructions and their desired operational semantics.
-
-<h2>Download</h2>
-<ul>
-<li><a href="http://hackage.haskell.org/package/operational">Latest version</a> on hackage</li>
-<li><a href="http://code.haskell.org/operational">Darcs repository</a></li>
-</ul>
-
-<h2>Documentation</h2>
-<ul>
-<li><a href="http://themonadreader.wordpress.com/2010/01/26/issue-15/">The Operational Monad Tutorial</a> - Introductory document explaining the concept.</li>
-<li><a href="http://projects.haskell.org/operational/Documentation.html">Library documentation</a> - How to use the libary proper; documents changes with respect to the tutorial.</li>
-<li><a href="http://hackage.haskell.org/package/operational/">API Reference</a> on hackage</li>
-<li><a href="http://projects.haskell.org/operational/examples.html">Example code</a> - Collection of working examples.</li>
-</ul>
-
-<h2>Authors</h2>
-<i><a href="http://apfelmus.nfshost.com/">Heinrich Apfelmus</a>, April 2010</i>
-
-</body></html>
diff --git a/operational.cabal b/operational.cabal
--- a/operational.cabal
+++ b/operational.cabal
@@ -1,5 +1,5 @@
 Name:               operational
-Version:            0.2.0.2
+Version:            0.2.0.3
 Synopsis:           Implement monads by specifying operational semantics.
 Description:
   Tiny library for implementing monads by specifying the primitive instructions
@@ -17,26 +17,22 @@
 License-file:       LICENSE
 Author:             Heinrich Apfelmus
 Maintainer:         Heinrich Apfelmus <apfelmus quantentunnel de>
-Copyright:          (c) Heinrich Apfelmus 2010
-Homepage:           http://projects.haskell.org/operational/
+Copyright:          (c) Heinrich Apfelmus 2010-2011
+Homepage:           http://haskell.org/haskellwiki/Operational
 Stability:          Provisional
 
 build-type:         Simple
 cabal-version:      >= 1.6
 extra-source-files: CHANGELOG
-                    docs/Documentation.md
-                    docs/Makefile
-                    docs/examples/*.hs
-                    docs/examples/*.lhs
-                    docs/web/fptools.css
-                    docs/web/*.html
-                    docs/web/examples/hscolour.css
-                    docs/web/examples/*.hs.html
-                    docs/web/examples/*.lhs.html
+                    doc/Documentation.md
+                    doc/examples/*.hs
+                    doc/examples/*.lhs
+                    doc/web/fptools.css
+                    doc/web/Documentation.html
                     
 source-repository head
-    type:           darcs
-    location:       http://code.haskell.org/operational
+    type:           git
+    location:       git://github.com/HeinrichApfelmus/operational.git
 
 Library
     hs-source-dirs:     src
@@ -47,7 +43,7 @@
     exposed-modules:    Control.Monad.Operational
 
 Executable TicTacToe
-    main-is:            docs/examples/TicTacToe.hs
+    main-is:            doc/examples/TicTacToe.hs
     hs-source-dirs:     src, .
     build-depends:      random == 1.*
     other-modules:      Control.Monad.Operational
diff --git a/src/Control/Monad/Operational.hs b/src/Control/Monad/Operational.hs
--- a/src/Control/Monad/Operational.hs
+++ b/src/Control/Monad/Operational.hs
@@ -5,9 +5,9 @@
 
 This package is based on the \"The Operational Monad Tutorial\", published in Issue 15 of The Monad.Reader <http://themonadreader.wordpress.com/>.
 
-You are reading the API reference. For more thorough documentation including design and implementation notes as well as a correctness proof, please consult the included documentation in @docs\/Documentation.html@, also available at <http://projects.haskell.org/operational/Documentation.html> .
+You are reading the API reference. For more thorough documentation including design and implementation notes as well as a correctness proof, please consult the included documentation in @doc\/Documentation.md@, also available at <http://heinrichapfelmus.github.com/operational/Documentation.html> .
 
-This API reference includes only basic example code. More intricate examples are available in the @docs\/examples@ directory, also available at <http://projects.haskell.org/operational/examples.html>.
+This API reference includes only basic example code. More intricate examples are available in the @doc\/examples@ directory, also available at <https://github.com/HeinrichApfelmus/operational/tree/master/doc/examples#readme>.
 -}
 module Control.Monad.Operational (
     -- * Basic usage
@@ -30,7 +30,7 @@
 -- import Control.Monad.Error.Class
 -- import Control.Monad.Reader.Class
 import Control.Monad.State.Class
--- import Control.Monad.Writer.Class
+-- import Control.Monad.Writer.Class
 
 {------------------------------------------------------------------------------
    Program
@@ -191,7 +191,8 @@
 {------------------------------------------------------------------------------
     mtl instances
     
-  * All of these instances need UndecidableInstances,    because they do not satisfy the coverage condition.
+  * All of these instances need UndecidableInstances,
+    because they do not satisfy the coverage condition.
     
   * We can only make instances of those classes
     that do not contain control operators. Control operators are
