diff --git a/LICENSE b/LICENSE
new file mode 100644
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2018 Kadzuya OKAMOTO, https://arow.info
+
+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/README.md b/README.md
new file mode 100644
--- /dev/null
+++ b/README.md
@@ -0,0 +1,8 @@
+[![Build Status](https://travis-ci.org/arowM/haskell-transaction.svg?branch=master)](https://travis-ci.org/arowM/haskell-transaction)
+[![Hackage](https://img.shields.io/hackage/v/transaction.svg)](https://hackage.haskell.org/package/transaction)
+[![Stackage LTS](http://stackage.org/package/transaction/badge/lts)](http://stackage.org/lts/package/transaction)
+[![Stackage Nightly](http://stackage.org/package/transaction/badge/nightly)](http://stackage.org/nightly/package/transaction)
+
+# Haskell-transaction
+
+Monadic representation of transactions.
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/src/Data/Transaction.hs b/src/Data/Transaction.hs
new file mode 100644
--- /dev/null
+++ b/src/Data/Transaction.hs
@@ -0,0 +1,128 @@
+{-# LANGUAGE DeriveFunctor #-}
+
+{- |
+Module      :  Data.Transaction
+
+Copyright   :  Kadzuya Okamoto 2018
+License     :  MIT
+
+Stability   :  experimental
+Portability :  unknown
+
+Monadic representation of transactions.
+-}
+module Data.Transaction
+  (
+  -- * Constructors
+  action
+
+  -- * Converters
+  , reduce
+  , toList
+  , tMap
+  , tFilter
+  , tFilterMap
+
+  -- * Types
+  , Transaction
+  , TransactionM
+  ) where
+
+{- ==============
+ -     Types
+ - ============== -}
+
+data TransactionM a x
+  = TVal a (TransactionM a x)
+  | TNull x
+  deriving (Functor)
+
+type Transaction a = TransactionM a ()
+
+instance Applicative (TransactionM a) where
+  pure = TNull
+  TVal a next <*> f = TVal a (next <*> f)
+  TNull g <*> f = f >>= (pure . g)
+
+instance Monad (TransactionM a) where
+  return = pure
+  TVal a next >>= f = TVal a (next >>= f)
+  TNull a >>= f = f a
+
+{- ==============
+ -   Operators
+ - ============== -}
+
+{- |
+>>> :{
+toList $ do
+  action 4
+  action 5
+  action 6
+:}
+[4,5,6]
+-}
+action :: a -> Transaction a
+action a = TVal a $ pure ()
+
+{- ==============
+ -   Converters
+ - ============== -}
+
+{- |
+>>> :{
+toList $ do
+  action 4
+  tMap (+1) $ do
+    action 5
+    action 6
+  action 7
+:}
+[4,6,7,7]
+-}
+tMap :: (a -> b) -> Transaction a -> Transaction b
+tMap f = tFilterMap (pure . f)
+
+{- |
+>>> :{
+toList $ do
+  action 4
+  tFilter even $ do
+    action 5
+    action 6
+  action 7
+:}
+[4,6,7]
+-}
+tFilter :: (a -> Bool) -> Transaction a -> Transaction a
+tFilter p = tFilterMap $ \a ->
+  if p a
+    then Just a
+    else Nothing
+
+{- |
+>>> :{
+toList $ do
+  action 4
+  tFilterMap (\x -> if even x then Just (x + 1) else Nothing) $ do
+    action 5
+    action 6
+  action 7
+:}
+[4,7,7]
+-}
+tFilterMap :: (a -> Maybe b) -> Transaction a -> Transaction b
+tFilterMap f (TVal a next) =
+  case f a of
+    Just b ->
+      TVal b $ tFilterMap f next
+    Nothing ->
+      tFilterMap f next
+tFilterMap _ (TNull ()) = TNull ()
+
+reduce :: (b -> a -> b) -> b -> Transaction a -> b
+reduce f b (TVal a next) = reduce f (f b a) next
+reduce _ b (TNull ()) = b
+
+toList :: Transaction a -> [a]
+toList trans = reduce (\f a -> f . (a:)) id trans []
diff --git a/test/Doctest.hs b/test/Doctest.hs
new file mode 100644
--- /dev/null
+++ b/test/Doctest.hs
@@ -0,0 +1,19 @@
+module Main where
+
+import Data.Monoid ((<>))
+import System.FilePath.Glob (glob)
+import Test.DocTest (doctest)
+
+main :: IO ()
+main = glob "src/**/*.hs" >>= doDocTest
+
+doDocTest :: [String] -> IO ()
+doDocTest options = doctest $ options <> ghcExtensions
+
+ghcExtensions :: [String]
+ghcExtensions =
+    [ "-XOverloadedStrings"
+    , "-XRecordWildCards"
+    , "-XStrict"
+    , "-XStrictData"
+    ]
diff --git a/test/Spec.hs b/test/Spec.hs
new file mode 100644
--- /dev/null
+++ b/test/Spec.hs
@@ -0,0 +1,2 @@
+main :: IO ()
+main = putStrLn "Test suite not yet implemented"
diff --git a/transaction.cabal b/transaction.cabal
new file mode 100644
--- /dev/null
+++ b/transaction.cabal
@@ -0,0 +1,51 @@
+name:                transaction
+version:             0.1.0.0
+synopsis:            Monadic representation of transactions.
+description:
+    Monadic representation of transactions.
+homepage:            https://github.com/arowM/haskell-transaction#readme
+license:             MIT
+license-file:        LICENSE
+author:              Kadzuya Okamoto
+maintainer:          arow.okamoto+github@gmail.com
+copyright:           2018 Kadzuya Okamoto
+category:            Data
+build-type:          Simple
+extra-source-files:  README.md
+cabal-version:       >=1.10
+
+library
+  hs-source-dirs:      src
+  exposed-modules:     Data.Transaction
+  build-depends:       base >= 4.9 && < 5
+  default-language:    Haskell2010
+  default-extensions:  OverloadedStrings
+                     , RecordWildCards
+  other-extensions:    GeneralizedNewtypeDeriving
+  ghc-options:         -Wcompat -Wall
+  if !impl(ghc >= 8.0)
+    build-depends: semigroups == 0.18.*
+
+test-suite transaction-test
+  type:                exitcode-stdio-1.0
+  hs-source-dirs:      test
+  main-is:             Spec.hs
+  build-depends:       base
+                     , transaction
+  ghc-options:         -threaded -rtsopts -with-rtsopts=-N
+  default-language:    Haskell2010
+
+test-suite doctest
+  type:                exitcode-stdio-1.0
+  hs-source-dirs:      test
+  main-is:             Doctest.hs
+  build-depends:       base
+                     , Glob
+                     , doctest >= 0.10
+                     , transaction
+  ghc-options:         -threaded -rtsopts -with-rtsopts=-N
+  default-language:    Haskell2010
+
+source-repository head
+  type:     git
+  location: https://github.com/arowM/haskell-transaction
