diff --git a/LICENSE b/LICENSE
new file mode 100644
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,18 @@
+This library is based on code found on the HaskellWiki, and subject to the
+license found there:
+
+  http://www.haskell.org/haskellwiki/HaskellWiki:Copyrights
+
+Permission is hereby granted, free of charge, to any person obtaining this
+work (the "Work"), to deal in the Work without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Work, and to permit
+persons to whom the Work is furnished to do so.
+
+THE WORK 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 WORK OR THE USE OR OTHER DEALINGS IN
+THE WORK.
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/monad-supply.cabal b/monad-supply.cabal
new file mode 100644
--- /dev/null
+++ b/monad-supply.cabal
@@ -0,0 +1,23 @@
+Name:          monad-supply
+Build-type:    Simple
+Version:       0.1
+Cabal-Version: >= 1.6
+Synopsis:      Stateful supply monad.
+Description:   Support for computations which consume values from a (possibly infinite) supply.
+License:       OtherLicense
+License-file:  LICENSE
+Category:      Control, Data, Monads
+Author:        Geoff Hulette and unknown HaskellWiki contributor(s).
+Maintainer:    Geoff Hulette <ghulette@gmail.com>
+Stability:     experimental
+Tested-With:   GHC == 7.0.3
+
+Library
+  Exposed-modules: Control.Monad.Supply
+  Hs-Source-Dirs:  src
+  Build-Depends:   base >= 4 && < 5,mtl >= 2
+  GHC-Options:     -Wall
+
+Source-Repository head
+  type:     git
+  location: git://github.com/ghulette/monad-supply.git
diff --git a/src/Control/Monad/Supply.hs b/src/Control/Monad/Supply.hs
new file mode 100644
--- /dev/null
+++ b/src/Control/Monad/Supply.hs
@@ -0,0 +1,64 @@
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE FunctionalDependencies #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+
+-- | Support for computations which consume values from a (possibly infinite)
+-- supply. See http://www.haskell.org/haskellwiki/New_monads/MonadSupply for
+-- details.
+module Control.Monad.Supply
+( MonadSupply
+, SupplyT
+, Supply
+, evalSupplyT
+, evalSupply
+, runSupplyT
+, runSupply
+, supplies
+) where
+
+import Control.Monad.Identity
+import Control.Monad.State
+import Data.Monoid
+
+class Monad m => MonadSupply s m | m -> s where
+  supply :: m s
+
+-- | Supply monad transformer.
+newtype SupplyT s m a = SupplyT (StateT [s] m a)
+  deriving (Functor, Monad, MonadTrans, MonadIO)
+
+-- | Supply monad. 
+newtype Supply s a = Supply (SupplyT s Identity a)
+  deriving (Functor, Monad, MonadSupply s)
+
+instance Monad m => MonadSupply s (SupplyT s m) where
+  supply = SupplyT $ do (x:xs) <- get
+                        put xs
+                        return x
+
+-- | Monoid instance for the supply monad. Actually any monad/monoid pair gives
+-- rise to this monoid instance, but we can't write it like that because it
+-- would conflict with existing instances provided by Data.Monoid.
+instance (Monoid a) => Monoid (Supply s a) where
+  mempty = return mempty
+  m1 `mappend` m2 = do
+    x1 <- m1
+    x2 <- m2
+    return (x1 `mappend` x2)
+
+-- | Get n supplies.
+supplies :: MonadSupply s m => Int -> m [s]
+supplies n = replicateM n supply
+
+evalSupplyT :: Monad m => SupplyT s m a -> [s] -> m a
+evalSupplyT (SupplyT s) = evalStateT s
+
+evalSupply :: Supply s a -> [s] -> a
+evalSupply (Supply s) = runIdentity . evalSupplyT s
+
+runSupplyT :: Monad m => SupplyT s m a -> [s] -> m (a,[s])
+runSupplyT (SupplyT s) = runStateT s
+
+runSupply :: Supply s a -> [s] -> (a,[s])
+runSupply (Supply s) = runIdentity . runSupplyT s
