diff --git a/LICENSE b/LICENSE
new file mode 100644
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,30 @@
+Copyright Sean Hess (c) 2016
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials provided
+      with the distribution.
+
+    * Neither the name of Sean Hess nor the names of other
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/README.md b/README.md
new file mode 100644
--- /dev/null
+++ b/README.md
@@ -0,0 +1,6 @@
+# Validated Types
+
+Type-level constraints on strings and other input
+
+See the [Refined](https://hackage.haskell.org/package/refined) package
+
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/CharLength.hs b/src/Data/CharLength.hs
new file mode 100644
--- /dev/null
+++ b/src/Data/CharLength.hs
@@ -0,0 +1,24 @@
+{-# LANGUAGE OverloadedStrings #-}
+module Data.CharLength
+  ( CharLength(..)
+  ) where
+
+import Data.Text (Text)
+import qualified Data.Text as Text
+
+-- | tools to detect the length of a type
+
+class CharLength a where
+  charLength :: a -> Int
+  charLength a = Text.length $ charOut a
+
+  charOut :: a -> Text
+  charIn :: Text -> a
+
+instance CharLength Text where
+  charOut = id
+  charIn = id
+
+instance CharLength Int where
+  charOut = Text.pack . show
+  charIn = read . Text.unpack
diff --git a/src/Refined/Implies.hs b/src/Refined/Implies.hs
new file mode 100644
--- /dev/null
+++ b/src/Refined/Implies.hs
@@ -0,0 +1,33 @@
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE KindSignatures #-}
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE TypeOperators #-}
+{-# LANGUAGE TypeFamilies #-}
+module Refined.Implies where
+
+import Refined (Refined, Predicate(..))
+import Refined (EqualTo, LessThan)
+import Refined.LessThanEq (LessThanEq)
+import Refined.Length (Length)
+import Data.Monoid ((<>))
+import Data.Coerce (coerce)
+import Data.CharLength (CharLength(..))
+
+import GHC.TypeLits
+
+-- | Certain refinedments imply others. See https://github.com/nikita-volkov/refined/pull/6
+
+class Implies from to where
+    relax :: Refined from x -> Refined to x
+    relax = coerce
+
+
+instance (n <= m) => Implies (LessThan n) (LessThan m)
+instance (n + 1 <= m) => Implies (EqualTo n) (LessThan m)
+instance (n <= m) => Implies (EqualTo n) (LessThanEq m)
+
+instance (Implies m n) => Implies (Length m) (Length n)
+
+
diff --git a/src/Refined/Length.hs b/src/Refined/Length.hs
new file mode 100644
--- /dev/null
+++ b/src/Refined/Length.hs
@@ -0,0 +1,36 @@
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE KindSignatures #-}
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE ConstraintKinds #-}
+{-# LANGUAGE RankNTypes #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+module Refined.Length where
+
+import Refined (Predicate(..))
+import Refined (EqualTo)
+import Refined.LessThanEq (LessThanEq)
+import Data.CharLength (CharLength(..))
+
+import GHC.TypeLits (Nat)
+
+
+-- | The length of an input
+data Length p
+
+instance (CharLength x, Predicate p Int) => Predicate (Length p) x where
+  validate _ x =
+    showString "Length of string: " <$>
+      validate (undefined :: p) (charLength x)
+
+
+type LengthEq (n :: Nat) =
+    Length (EqualTo n)
+
+type LengthMax (n :: Nat) =
+    Length (LessThanEq n)
+
+
+
+
diff --git a/src/Refined/LessThanEq.hs b/src/Refined/LessThanEq.hs
new file mode 100644
--- /dev/null
+++ b/src/Refined/LessThanEq.hs
@@ -0,0 +1,24 @@
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE KindSignatures #-}
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE TypeOperators #-}
+{-# LANGUAGE TypeFamilies #-}
+module Refined.LessThanEq where
+
+import Refined (Predicate(..))
+import Data.Monoid ((<>))
+
+import GHC.TypeLits (Nat, KnownNat, natVal)
+
+data LessThanEq (n :: Nat)
+
+instance (Ord x, Num x, KnownNat n) => Predicate (LessThanEq n) x where
+  validate p x =
+    if x <= fromIntegral x'
+      then Nothing
+      else Just ("Value is not less than or eq " <> show x')
+    where
+      x' = natVal p
+
diff --git a/src/Refined/OnlyDigits.hs b/src/Refined/OnlyDigits.hs
new file mode 100644
--- /dev/null
+++ b/src/Refined/OnlyDigits.hs
@@ -0,0 +1,31 @@
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE KindSignatures #-}
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE TypeOperators #-}
+{-# LANGUAGE TypeFamilies #-}
+module Refined.OnlyDigits where
+
+import Refined (Predicate(..))
+import Data.Char (isDigit)
+import Data.Monoid ((<>))
+import Data.Text (Text)
+import qualified Data.Text as Text
+
+data OnlyDigits
+
+
+
+instance Predicate OnlyDigits Text where
+  validate _ x =
+    if Text.all isDigit x
+      then Nothing
+      else Just ("Value contains non-digits " <> show x)
+
+
+instance Predicate OnlyDigits String where
+  validate _ x =
+    if all isDigit x
+      then Nothing
+      else Just ("Value contains non-digits " <> show x)
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/validated-types.cabal b/validated-types.cabal
new file mode 100644
--- /dev/null
+++ b/validated-types.cabal
@@ -0,0 +1,41 @@
+name:                validated-types
+version:             0.1.1
+synopsis:            Type-level constraints on strings and other input
+description:         Please see README.md
+homepage:            https://github.com/seanhess/validated-types#readme
+license:             BSD3
+license-file:        LICENSE
+author:              Sean Hess
+maintainer:          seanhess@gmail.com
+copyright:           Orbital Labs
+category:            Web
+build-type:          Simple
+extra-source-files:  README.md
+cabal-version:       >=1.10
+
+library
+  hs-source-dirs:      src
+  exposed-modules:
+      Refined.Length
+    , Refined.LessThanEq
+    , Refined.Implies
+    , Refined.OnlyDigits
+    , Data.CharLength
+  build-depends:
+      base >= 4.7 && < 5
+    , refined
+    , text
+  default-language:    Haskell2010
+
+test-suite validated-types-test
+  type:                exitcode-stdio-1.0
+  hs-source-dirs:      test
+  main-is:             Spec.hs
+  build-depends:       base
+                     , validated-types
+  ghc-options:         -threaded -rtsopts -with-rtsopts=-N
+  default-language:    Haskell2010
+
+source-repository head
+  type:     git
+  location: https://github.com/seanhess/validated-types
