diff --git a/LICENSE b/LICENSE
new file mode 100644
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,8 @@
+The MIT License (MIT)
+Copyright (c) 2016 (Philipp Pfeiffer)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/Setup.hs b/Setup.hs
new file mode 100644
--- /dev/null
+++ b/Setup.hs
@@ -0,0 +1,2 @@
+import Distribution.Simple
+main = defaultMain
diff --git a/atrans.cabal b/atrans.cabal
new file mode 100644
--- /dev/null
+++ b/atrans.cabal
@@ -0,0 +1,23 @@
+name:                atrans
+version:             0.1.0.0
+synopsis:            A small collection of monad (transformer) instances.
+description:         Defines monad transformers and gives instances based on the mtl transformer library.
+homepage:            https://github.com/aphorisme/atrans
+license:             MIT
+license-file:        LICENSE
+author:              Philipp Pfeiffer
+maintainer:          pfiff@hax-f.net
+-- copyright:
+category:            Monads
+build-type:          Simple
+-- extra-source-files:
+cabal-version:       >=1.10
+
+library
+  exposed-modules:       Control.Monad.Backend
+  -- other-modules:
+  -- other-extensions:
+  build-depends:         base >=4.7 && <5
+                       , mtl >= 2.2.1
+  hs-source-dirs:      src
+  default-language:    Haskell2010
diff --git a/src/Control/Monad/Backend.hs b/src/Control/Monad/Backend.hs
new file mode 100644
--- /dev/null
+++ b/src/Control/Monad/Backend.hs
@@ -0,0 +1,49 @@
+{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-}
+{-|
+Module      : Control.Monad.Backend
+Description : A variant of the state transformer.
+Copyright   : (c) Philipp Pfeiffer, 2016
+License     : MIT
+Maintainer  : pfiff@hax-f.net
+Stability   : experimental
+Portability : POSIX
+
+Defines the 'BackendT' transformer, which is a variant of the 'StateT' transformer, such that the state is within an 'MVar'.
+-}
+module Control.Monad.Backend where
+
+
+
+import Control.Monad.Except
+import Control.Monad.State
+import Control.Concurrent.MVar (MVar, isEmptyMVar, takeMVar, putMVar, readMVar)
+import Control.Arrow (second)
+
+
+-- | The 'BackendT' transformer is a 'StateT', where the state is encapsulated into a 'MVar'.
+newtype BackendT s m a = BackendT (MVar s -> m (MVar s, a))
+
+-- | 'runBackendT' unwraps the 'BackendT' monad.
+runBackendT :: BackendT s m a -> MVar s -> m (MVar s, a)
+runBackendT (BackendT f) = f
+
+instance (Functor m) => Functor (BackendT s m) where
+  fmap f bt = BackendT $ \s -> fmap (second f) (runBackendT bt s)
+
+instance (Monad m) => Applicative (BackendT s m) where
+  pure x = BackendT $ \s -> pure (s, x)
+  pf <*> q = BackendT $ \s -> do { (s', f) <- runBackendT pf s; (s'', x) <- runBackendT q s'; return (s'', f x) }
+
+instance (Monad m) => Monad (BackendT s m) where
+  return x = BackendT $ \s -> return (s, x)
+  p >>= (fq) = BackendT $ \s -> do { (s', x) <- runBackendT p s; runBackendT (fq x) s' }
+
+instance (Monad m, MonadIO m) => MonadState s (BackendT s m) where
+  get = BackendT $ \s -> do { v <- liftIO (readMVar s); return (s, v) }
+  put s = BackendT $
+    \st -> do b <- liftIO (isEmptyMVar st)
+              if b then do { liftIO (putMVar st s); return (st, ()) }
+              else do { liftIO (takeMVar st); liftIO (putMVar st s); return (st, ()) }
+
+instance (Monad m, MonadIO m) => MonadIO (BackendT s m) where
+  liftIO io = BackendT $ \s -> do { x <- liftIO io; return (s, x) }
