diff --git a/.gitignore b/.gitignore
new file mode 100644
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+.cabal-sandbox
+cabal.sandbox.config
+dist
diff --git a/ChangeLog.md b/ChangeLog.md
new file mode 100644
--- /dev/null
+++ b/ChangeLog.md
@@ -0,0 +1,3 @@
+# 0.0.1 (2015-05-14)
+
+* Initial release.
diff --git a/LICENSE b/LICENSE
new file mode 100644
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2015 Johan Kiviniemi
+
+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,11 @@
+# `acme-memorandom`
+
+[![Hackage](https://budueba.com/hackage/acme-memorandom)](https://hackage.haskell.org/package/acme-memorandom)
+
+A library for generating random numbers in a memoized manner. Implemented as a
+lazy table indexed by serialized [`StdGen`][StdGen]. Monomorphism is used to
+facilitate memoization, users should adapt their design to work with random
+[`Int`][Int] values only.
+
+[StdGen]: http://hackage.haskell.org/package/random/docs/System-Random.html#t:StdGen
+[Int]:    https://hackage.haskell.org/package/base/docs/Prelude.html#t:Int
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/acme-memorandom.cabal b/acme-memorandom.cabal
new file mode 100644
--- /dev/null
+++ b/acme-memorandom.cabal
@@ -0,0 +1,38 @@
+name: acme-memorandom
+category: ACME
+version: 0.0.1
+license: MIT
+license-file: LICENSE
+author: Johan Kiviniemi <devel@johan.kiviniemi.name>
+maintainer: Johan Kiviniemi <devel@johan.kiviniemi.name>
+stability: provisional
+homepage: https://github.com/ion1/acme-memorandom
+bug-reports: https://github.com/ion1/acme-memorandom/issues
+copyright: Copyright © 2015 Johan Kiviniemi
+synopsis: Memoized random number generation
+description:
+  A library for generating random numbers in a memoized manner. Implemented as
+  a lazy table indexed by serialized 'StdGen'. Monomorphism is used to
+  facilitate memoization, users should adapt their design to work with random
+  'Int' values only.
+tested-with: GHC == 7.10.1
+
+build-type: Simple
+cabal-version: >=1.10
+extra-source-files:
+  .gitignore
+  ChangeLog.md
+  README.md
+
+source-repository head
+  type: git
+  location: https://github.com/ion1/acme-memorandom.git
+
+library
+  exposed-modules: System.Random.MemoRandom
+  hs-source-dirs: src
+  other-extensions: TypeFamilies, TypeOperators
+  build-depends: base == 4.*
+               , MemoTrie == 0.6.*
+               , random == 1.*
+  default-language: Haskell2010
diff --git a/src/System/Random/MemoRandom.hs b/src/System/Random/MemoRandom.hs
new file mode 100644
--- /dev/null
+++ b/src/System/Random/MemoRandom.hs
@@ -0,0 +1,36 @@
+{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE TypeOperators #-}
+
+-- |
+-- Module      : Systen.Random.MemoRandom
+-- Description : Memoized random number generation
+-- Copyright   : © 2015 Johan Kiviniemi
+-- License     : MIT
+-- Maintainer  : Johan Kiviniemi <devel@johan.kiviniemi.name>
+-- Stability   : provisional
+-- Portability : TypeFamilies, TypeOperators
+--
+-- A library for generating random numbers in a memoized manner. Implemented as
+-- a lazy table indexed by serialized 'StdGen'. Monomorphism is used to
+-- facilitate memoization, users should adapt their design to work with random
+-- 'Int' values only.
+module System.Random.MemoRandom (randomR', random') where
+
+import Data.MemoTrie
+import System.Random
+
+newtype StdGen' = StdGen' { unStdGen' :: StdGen }
+
+instance HasTrie StdGen' where
+  newtype StdGen' :->: a = StdGenTrie' (String :->: a)
+  trie f = StdGenTrie' (trie (f . StdGen' . read))
+  untrie (StdGenTrie' t) = untrie t . show . unStdGen'
+  enumerate (StdGenTrie' t) = [ (StdGen' (read a), b) | (a,b) <- enumerate t ]
+
+-- | A memoized variant of 'randomR'.
+randomR' :: (Int, Int) -> StdGen -> (Int, StdGen)
+randomR' ival = memo2 (\ival' -> randomR ival' . unStdGen') ival . StdGen'
+
+-- | A memoized variant of 'random'.
+random' :: StdGen -> (Int, StdGen)
+random' = memo (random . unStdGen') . StdGen'
