diff --git a/Setup.hs b/Setup.hs
--- a/Setup.hs
+++ b/Setup.hs
@@ -1,2 +1,3 @@
 import Distribution.Simple
+
 main = defaultMain
diff --git a/genvalidity-text.cabal b/genvalidity-text.cabal
--- a/genvalidity-text.cabal
+++ b/genvalidity-text.cabal
@@ -1,55 +1,49 @@
-name:                genvalidity-text
-version:             0.2.0.0
-synopsis:            GenValidity support for Text
-description:         Please see README.md
-homepage:            https://github.com/NorfairKing/validity#readme
-license:             MIT
-license-file:        LICENSE
-author:              Tom Sydney Kerckhove
-maintainer:          syd.kerckhove@gmail.com
-copyright:           Copyright: (c) 2016 Tom Sydney Kerckhove
-category:            Testing
-build-type:          Simple
-cabal-version:       >=1.10
+name: genvalidity-text
+version: 0.3.0.0
+cabal-version: >=1.10
+build-type: Simple
+license: MIT
+license-file: LICENSE
+copyright: Copyright: (c) 2016 Tom Sydney Kerckhove
+maintainer: syd.kerckhove@gmail.com
+homepage: https://github.com/NorfairKing/validity#readme
+synopsis: GenValidity support for Text
+description:
+    Please see README.md
+category: Testing
+author: Tom Sydney Kerckhove
 
+source-repository head
+    type: git
+    location: https://github.com/NorfairKing/validity
+
 library
-  hs-source-dirs:      src
-  exposed-modules:     Data.GenValidity.Text
-  build-depends:       base       < 5
-                     , validity
-                     , validity-text
-                     , genvalidity
-                     , text
-                     , array
-                     , QuickCheck
-  default-language:    Haskell2010
+    exposed-modules:
+        Data.GenValidity.Text
+    build-depends:
+        base <5,
+        validity -any,
+        validity-text -any,
+        genvalidity -any,
+        text -any,
+        array -any,
+        QuickCheck -any
+    default-language: Haskell2010
+    hs-source-dirs: src
 
 test-suite genvalidity-text-test
-  type:
-    exitcode-stdio-1.0
-  default-language:
-    Haskell2010
-  hs-source-dirs:
-    test
-  main-is:
-    Spec.hs
-  other-modules:
-    Data.GenValidity.TextSpec
-  ghc-options:
-    -threaded -rtsopts -with-rtsopts=-N
-    -Wall
-    -fno-warn-name-shadowing
-  build-depends:
-      base
-
-    , hspec
-    , QuickCheck     >= 2.8 && < 2.9
-
-    , genvalidity
-    , genvalidity-text
-    , text
-
-
-source-repository head
-  type:     git
-  location: https://github.com/NorfairKing/validity
+    type: exitcode-stdio-1.0
+    main-is: Spec.hs
+    build-depends:
+        base -any,
+        hspec -any,
+        QuickCheck,
+        genvalidity -any,
+        genvalidity-text -any,
+        genvalidity-hspec -any,
+        text -any
+    default-language: Haskell2010
+    hs-source-dirs: test
+    other-modules:
+        Data.GenValidity.TextSpec
+    ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -fno-warn-name-shadowing
diff --git a/src/Data/GenValidity/Text.hs b/src/Data/GenValidity/Text.hs
--- a/src/Data/GenValidity/Text.hs
+++ b/src/Data/GenValidity/Text.hs
@@ -1,3 +1,5 @@
+{-# OPTIONS_GHC -Wno-orphans #-}
+
 module Data.GenValidity.Text where
 
 import Data.GenValidity
@@ -12,17 +14,19 @@
 import Data.Text.Internal (Text(..))
 
 instance GenUnchecked Text where
-    genUnchecked = Text <$> uncheckedArray <*> arbitrary <*> arbitrary
-      where
-        uncheckedArray =
-            sized $ \n -> do
-                size <- upTo n
-                ins <- replicateM size arbitrary
-                return $
-                    A.run $ do
-                        arr <- A.new size
-                        forM_ (zip [0 ..] ins) $ uncurry $ A.unsafeWrite arr
-                        return arr
+    genUnchecked =
+        sized $ \n -> do
+            size <- upTo n
+            arr <-
+                do ins <- replicateM size arbitrary
+                   return $
+                       A.run $ do
+                           arr <- A.new size
+                           forM_ (zip [0 ..] ins) $ uncurry $ A.unsafeWrite arr
+                           return arr
+            off <- upTo $ max 0 (size - 1)
+            let len = size - off
+            pure $ Text arr off len
 
 instance GenValid Text where
     genValid =
diff --git a/test/Data/GenValidity/TextSpec.hs b/test/Data/GenValidity/TextSpec.hs
--- a/test/Data/GenValidity/TextSpec.hs
+++ b/test/Data/GenValidity/TextSpec.hs
@@ -1,55 +1,46 @@
-module Data.GenValidity.TextSpec (spec) where
+module Data.GenValidity.TextSpec
+    ( spec
+    ) where
 
-import           Test.Hspec
-import           Test.QuickCheck
+import Test.Hspec
+import Test.QuickCheck
 
-import           Data.GenValidity
-import           Data.GenValidity.Text
+import Data.GenValidity
+import Data.GenValidity.Text
 
-import qualified Data.Text             as T
+import qualified Data.Text as T
 
 spec :: Spec
 spec = do
     describe "genValid" $ do
         it "is always empty when resized to 0" $ do
             forAll (resize 0 genValid) (`shouldSatisfy` T.null)
-
     describe "textStartingWith" $ do
         it "is never empty" $ do
             forAll arbitrary $ \c ->
-                forAll (textStartingWith c) $ \t ->
-                    t `shouldNotSatisfy` T.null
-
+                forAll (textStartingWith c) $ \t -> t `shouldNotSatisfy` T.null
         it "contains exactly the first character if resized to 0" $ do
             forAll arbitrary $ \c ->
                 forAll (resize 0 $ textStartingWith c) $ \t ->
                     t `shouldBe` T.pack [c]
-
         it "contains exactly the first character if resized to 1" $ do
             forAll arbitrary $ \c ->
                 forAll (resize 0 $ textStartingWith c) $ \t ->
                     t `shouldBe` T.pack [c]
-
         it "always starts with the given char" $ do
             forAll arbitrary $ \c ->
-                forAll (textStartingWith c) $ \t ->
-                    T.head t `shouldBe` c
-
+                forAll (textStartingWith c) $ \t -> T.head t `shouldBe` c
     describe "textWithA" $ do
         it "contains the given character" $ do
             forAll arbitrary $ \c ->
-                forAll (textWithA c) $ \t ->
-                    T.unpack t `shouldSatisfy` (elem c)
-
+                forAll (textWithA c) $ \t -> T.unpack t `shouldSatisfy` (elem c)
     describe "textWithoutAny" $ do
         it "never contains the given char" $ do
             forAll arbitrary $ \c ->
                 forAll (textWithoutAny c) $ \t ->
                     T.unpack t `shouldNotSatisfy` (elem c)
-
     describe "textWithoutAnyOf" $ do
         it "never contains any of the given chars" $ do
             forAll arbitrary $ \cs ->
-                forAll (textWithoutAnyOf cs) $ \t ->
-                    T.unpack t `shouldNotSatisfy` (\t -> any (`elem` t) cs)
-
+                forAll (textWithoutAnyOf cs) $ \text ->
+                    T.unpack text `shouldNotSatisfy` (\t -> any (`elem` t) cs)
