diff --git a/Control/Rematch.hs b/Control/Rematch.hs
new file mode 100644
--- /dev/null
+++ b/Control/Rematch.hs
@@ -0,0 +1,208 @@
+-- |This module defines an api for matchers: rules that can pass or fail,
+-- and describe their failure and success conditions for humans to read.
+--
+-- This module also exports some useful matchers for things in the "Prelude",
+-- and some combinators that are useful for combining several matchers into one.
+module Control.Rematch(
+    Matcher(..)
+  -- ** Useful functions for running matchers
+  , expect
+  , runMatch
+  -- ** Basic Matchers
+  , is
+  , equalTo
+  -- ** Matchers on lists
+  , isEmpty
+  , hasSize
+  , everyItem
+  , hasItem
+  -- ** Matchers on Ord
+  , greaterThan
+  , greaterThanOrEqual
+  , lessThan
+  , lessThanOrEqual
+  -- ** Matchers on Maybe
+  , isJust
+  , isNothing
+  -- ** Matchers on Either
+  , isRight
+  , isLeft
+  -- ** Matcher combinators
+  , no
+  , allOf
+  , anyOf
+  -- ** Utility functions for writing your own matchers
+  , matcherOn
+  , matchList
+  , standardMismatch
+  ) where
+import Test.HUnit(Assertion, assertFailure)
+import qualified Data.Maybe as M
+import Control.Rematch.Run
+import Control.Rematch.Formatting
+
+-- |The basic api for a matcher
+data Matcher a = Matcher {
+    match :: a -> Bool
+  -- ^ A function that returns True if the matcher should pass, False if it should fail
+  , description :: String
+  -- ^ A description of the matcher (usually of its success conditions)
+  , describeMismatch :: a -> String
+  -- ^ A description to be shown if the match fails.
+  }
+
+-- |Run a matcher as an HUnit assertion
+--
+-- Example output:
+--
+-- @
+-- Expected:
+-- equalTo \"a\"
+-- but:  was \"b\"
+-- @
+expect :: a -> Matcher a -> Assertion
+expect a matcher = case res of
+  MatchSuccess -> return ()
+  (MatchFailure msg) -> assertFailure msg
+  where res = runMatch matcher a
+
+-- |Inverts a matcher, so success becomes failure, and failure
+-- becomes success
+no :: Matcher a -> Matcher a
+no (Matcher m desc mismatch) = Matcher (not . m) ("not " ++ desc) mismatch
+
+-- |Run a matcher, producing a Match with a good error string
+runMatch :: Matcher a -> a -> Match
+runMatch m a = if match m a
+  then MatchSuccess
+  else MatchFailure $ "Expected:\n " ++ description m ++ "\n  but:  " ++ describeMismatch m a
+
+-- |Matcher on equality
+is :: (Show a, Eq a) => a -> Matcher a
+is a = Matcher (a == ) ("equalTo " ++ show a) standardMismatch
+
+-- |Matcher on equality
+equalTo :: (Show a, Eq a) => a -> Matcher a
+equalTo = is
+
+-- |Matches if all of a list of matchers pass
+allOf :: [Matcher a] -> Matcher a
+allOf [] = Matcher (const False) "allOf" (const "was: no matchers supplied")
+allOf matchers = Matcher {
+    match = and . matchList matchers
+  , description = describeList "all" $ map description matchers
+  , describeMismatch = \a -> describeList "" (map (`describeMismatch` a) (filter (\m -> not $ match m a) matchers))
+  }
+
+-- |Matches if any of a list of matchers pass
+anyOf :: [Matcher a] -> Matcher a
+anyOf [] = Matcher (const False) "anyOf" (const "was: no matchers supplied")
+anyOf matchers = Matcher {
+    match = or . matchList matchers
+  , description = describeList "or" $ map description matchers
+  , describeMismatch = \a -> describeList "" (map (`describeMismatch` a) matchers)
+  }
+
+-- |Matches if every item in the input list passes a matcher
+everyItem :: Matcher a -> Matcher [a]
+everyItem m = Matcher {
+    match = all (match m)
+  , description = "everyItem(" ++ description m ++ ")"
+  , describeMismatch = describeList "" . map (describeMismatch m) . filter (not . match m)
+  }
+
+-- |Matches if any of the items in the input list passes the provided matcher
+hasItem :: Matcher a -> Matcher [a]
+hasItem m = Matcher {
+    match = any (match m)
+  , description = "hasItem(" ++ description m ++ ")"
+  , describeMismatch = go
+  }
+  where go [] = "got an empty list: []"
+        go as = describeList "" (map (describeMismatch m) as)
+
+-- |Matches if the input list is empty
+isEmpty :: (Show a) => Matcher [a]
+isEmpty = Matcher {
+    match = null
+  , description = "isEmpty"
+  , describeMismatch = standardMismatch
+  }
+
+-- |Matches if the input list has the required size
+hasSize :: (Show a) => Int -> Matcher [a]
+hasSize n = Matcher {
+    match = ((== n) . length)
+  , description = "hasSize(" ++ show n ++ ")"
+  , describeMismatch = standardMismatch
+  }
+
+-- |Builds a Matcher a out of a name and a function from (a -> a -> Bool)
+-- Succeeds if the function returns true, fails if the function returns false
+matcherOn :: (Show a) => String -> (a -> a -> Bool) -> a -> Matcher a
+matcherOn name comp a = Matcher {
+    match = comp a
+  , description = name ++ "(" ++ show a ++ ")"
+  , describeMismatch = standardMismatch
+  }
+
+-- |Matches if the input is greater than the required number
+greaterThan :: (Ord a, Show a) => a -> Matcher a
+greaterThan = matcherOn "greaterThan" (<)
+
+-- |Matches if the input is greater than or equal to the required number
+greaterThanOrEqual :: (Ord a, Show a) => a -> Matcher a
+greaterThanOrEqual = matcherOn "greaterThanOrEqual" (<=)
+
+-- |Matches if the input is less than the required number
+lessThan :: (Ord a, Show a) => a -> Matcher a
+lessThan = matcherOn "lessThan" (>)
+
+-- |Matches if the input is less than or equal to the required number
+lessThanOrEqual :: (Ord a, Show a) => a -> Matcher a
+lessThanOrEqual = matcherOn "lessThanOrEqual" (>=)
+
+-- |Matches if the input is (Just a)
+isJust :: (Show a) => Matcher (Maybe a)
+isJust = Matcher {
+    match = M.isJust
+  , description = "isJust"
+  , describeMismatch = standardMismatch
+  }
+
+-- |Matches if the input is Nothing
+isNothing :: (Show a) => Matcher (Maybe a)
+isNothing = Matcher {
+    match = M.isNothing
+  , description = "isNothing"
+  , describeMismatch = standardMismatch
+  }
+
+-- |Matches if an Either is Right
+isRight :: (Show a, Show b) => Matcher (Either a b)
+isRight = Matcher {
+    match = go
+  , description = "isRight"
+  , describeMismatch = standardMismatch
+  }
+  where go (Right _) = True
+        go (Left _) = False
+
+-- |Matches if an Either is Left
+isLeft :: (Show a, Show b) => Matcher (Either a b)
+isLeft = Matcher {
+    match = go
+  , description = "isLeft"
+  , describeMismatch = standardMismatch
+  }
+  where go (Left _) = True
+        go (Right _) = False
+
+-- |Utility function for running a list of matchers
+matchList :: [Matcher a] -> a -> [Bool]
+matchList matchers a = map (`match` a) matchers
+
+-- |A standard mismatch description on (Show a):
+-- standardMismatch 1 == "was 1"
+standardMismatch :: (Show a) => a -> String
+standardMismatch a = "was " ++ show a
diff --git a/Control/Rematch/Formatting.hs b/Control/Rematch/Formatting.hs
new file mode 100644
--- /dev/null
+++ b/Control/Rematch/Formatting.hs
@@ -0,0 +1,14 @@
+-- |This module contains some utility functions for formatting descriptions
+-- It is probably only useful when you're writing your own matchers
+module Control.Rematch.Formatting where
+
+-- |Utility function for formatting a list of strings like the following.
+-- For example, describeList "anyOf" ["is 'a'"] == "anyOf(is 'a')"
+describeList :: String -> [String] -> String
+describeList start xs = start ++ "(" ++ join ", " xs ++ ")"
+
+-- |Utility function for formatting a list of strings with a separator
+join :: String -> [String] -> String
+join _ [] = ""
+join _ [a] = a
+join sep (x:xs) = x ++ sep ++ join sep xs
diff --git a/LICENSE b/LICENSE
new file mode 100644
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,7 @@
+Copyright (c) 2013 Tom Crayford
+
+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/rematch.cabal b/rematch.cabal
new file mode 100644
--- /dev/null
+++ b/rematch.cabal
@@ -0,0 +1,30 @@
+-- Initial rematch.cabal generated by cabal init.  For further 
+-- documentation, see http://haskell.org/cabal/users-guide/
+
+name:                rematch
+version:             0.1.0.0
+synopsis:            A simple api for "matchers"
+description:
+    Rematch is a simple library of matchers, which express rules
+    that can pass or fail. Matchers also report their failure with
+    human readable output. Custom matchers can be build, and
+    matchers can be combined using several predefined combinators
+    or you can write your own.
+
+    Matchers are often used in automated tests to provide expressive
+    failure messages.
+
+    Rematch is very similar to, and very inspired by the hamcrest
+    library for Java
+license:             MIT
+license-file:        LICENSE
+author:              Tom Crayford
+maintainer:          tcrayford@googlemail.com
+copyright:           Tom Crayford 2013
+category:            Control
+build-type:          Simple
+cabal-version:       >=1.8
+
+library
+  exposed-modules:     Control.Rematch, Control.Rematch.Formatting
+  build-depends:       base ==4.5.*, HUnit >= 1.0
