diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,16 @@
+# [1.7.1]
+
+- [Deprecate the `Data.Text.Prettyprint.*` modules](https://github.com/quchen/prettyprinter/pull/203)
+  * Users should migrate to the new `Prettyprinter` module hierarchy.
+  * The old modules will be removed no sooner than September 2022.
+- [Make `text` an optional dependency:](https://github.com/quchen/prettyprinter/pull/202)
+  * When built with `-f-text`, any `text`-based APIs will operate on `String`s instead.
+- Documentation improvements:
+  * [#194](https://github.com/quchen/prettyprinter/pull/194)
+  * [`1f0bffe`](https://github.com/quchen/prettyprinter/commit/1f0bffe5eb53874d1ba46b0a80bda67c02365f1b)
+
+[1.7.1]: https://github.com/quchen/prettyprinter/compare/v1.7.0...v1.7.1
+
 # [1.7.0]
 
 ## Breaking changes
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -5,12 +5,7 @@
 A modern Wadler/Leijen Prettyprinter
 ====================================
 
-[![](https://img.shields.io/travis/quchen/prettyprinter/master.svg?style=flat-square&label=Master%20build)](https://travis-ci.org/quchen/prettyprinter)
 [![](https://img.shields.io/hackage/v/prettyprinter.svg?style=flat-square&label=Hackage&colorB=0a7bbb)](https://hackage.haskell.org/package/prettyprinter)
-[![](https://www.stackage.org/package/prettyprinter/badge/lts?style=flat-square&colorB=0a7bbb)](https://www.stackage.org/package/prettyprinter)
-[![](https://www.stackage.org/package/prettyprinter/badge/nightly?style=flat-square&label=stackage%20nightly&colorB=0a7bbb)](https://www.stackage.org/package/prettyprinter)
-
-
 
 tl;dr
 -----
diff --git a/app/GenerateReadme.hs b/app/GenerateReadme.hs
--- a/app/GenerateReadme.hs
+++ b/app/GenerateReadme.hs
@@ -11,8 +11,8 @@
 import           Data.Text                             (Text)
 import qualified Data.Text                             as T
 import qualified Data.Text.IO                          as T
-import           Data.Text.Prettyprint.Doc
-import           Data.Text.Prettyprint.Doc.Render.Text
+import           Prettyprinter
+import           Prettyprinter.Render.Text
 
 import MultilineTh
 
diff --git a/bench/FasterUnsafeText.hs b/bench/FasterUnsafeText.hs
--- a/bench/FasterUnsafeText.hs
+++ b/bench/FasterUnsafeText.hs
@@ -6,9 +6,9 @@
 
 import           Gauge.Main
 import           Data.Char
-import           Data.Text                          (Text)
-import qualified Data.Text                          as T
-import           Data.Text.Prettyprint.Doc.Internal
+import           Data.Text              (Text)
+import qualified Data.Text              as T
+import           Prettyprinter.Internal
 
 
 
diff --git a/bench/Fusion.hs b/bench/Fusion.hs
--- a/bench/Fusion.hs
+++ b/bench/Fusion.hs
@@ -14,9 +14,9 @@
 import qualified Data.Text           as T
 import           System.Random
 
-import           Data.Text.Prettyprint.Doc
-import           Data.Text.Prettyprint.Doc.Render.Text
-import qualified Text.PrettyPrint.ANSI.Leijen          as WL
+import           Prettyprinter
+import           Prettyprinter.Render.Text
+import qualified Text.PrettyPrint.ANSI.Leijen as WL
 
 #if !(APPLICATIVE_MONAD)
 import Control.Applicative
diff --git a/bench/LargeOutput.hs b/bench/LargeOutput.hs
--- a/bench/LargeOutput.hs
+++ b/bench/LargeOutput.hs
@@ -18,8 +18,8 @@
 import qualified Data.Text                             as T
 import qualified Data.Text.IO                          as T
 import qualified Data.Text.Lazy                        as TL
-import           Data.Text.Prettyprint.Doc
-import           Data.Text.Prettyprint.Doc.Render.Text
+import           Prettyprinter
+import           Prettyprinter.Render.Text
 import           GHC.Generics
 import           Test.QuickCheck
 import           Test.QuickCheck.Gen
diff --git a/prettyprinter.cabal b/prettyprinter.cabal
--- a/prettyprinter.cabal
+++ b/prettyprinter.cabal
@@ -1,5 +1,5 @@
 name:                prettyprinter
-version:             1.7.0
+version:             1.7.1
 cabal-version:       >= 1.10
 category:            User Interfaces, Text
 synopsis:            A modern, easy to use, well-documented, extensible pretty-printer.
@@ -9,13 +9,12 @@
 extra-source-files:  README.md
                    , CHANGELOG.md
                    , misc/version-compatibility-macros.h
-author:              Phil Wadler, Daan Leijen, Max Bolingbroke, Edward Kmett, David Luposchainsky
+author:              Phil Wadler, Daan Leijen, Max Bolingbroke, Edward Kmett, David Luposchainsky, Simon Jakobi
 maintainer:          Simon Jakobi <simon.jakobi@gmail.com>, David Luposchainsky <dluposchainsky at google>
 bug-reports:         http://github.com/quchen/prettyprinter/issues
 homepage:            http://github.com/quchen/prettyprinter
 build-type:          Simple
-
-
+tested-with:         GHC==9.0.1, GHC==8.10.4, GHC==8.8.4, GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2
 
 source-repository head
     type: git
@@ -70,8 +69,18 @@
 
     build-depends:
           base >= 4.5 && < 5
-        , text >= 1.2
 
+    if flag(text)
+        build-depends: text >= 1.2
+    else
+        -- A fake text package, emulating the same API, but backed by String
+        hs-source-dirs: src-text
+        other-modules:
+              Data.Text
+            , Data.Text.IO
+            , Data.Text.Lazy
+            , Data.Text.Lazy.Builder
+
     if !impl(ghc >= 7.6)
         build-depends: ghc-prim
 
@@ -89,7 +98,15 @@
   Description: Build the readme generator
   Default:     False
 
+Flag text
+  Description: While it's a core value of @prettyprinter@ to use @Text@, there are rare
+               circumstances (mostly when @prettyprinter@ arises as a dependency of
+               test suites of packages like @bytestring@ or @text@ themselves) when
+               this is inconvenient. In this case one can disable this flag, so that
+               @prettyprinter@ fallbacks to @String@.
+  Default:     True
 
+
 executable generate_readme
     hs-source-dirs: app
     main-is: GenerateReadme.hs
@@ -104,7 +121,7 @@
     other-extensions: OverloadedStrings
                     , TemplateHaskell
                     , QuasiQuotes
-    if flag(buildReadme)
+    if flag(buildReadme) && flag(text)
         buildable: True
     else
         buildable: False
@@ -136,7 +153,7 @@
         , prettyprinter
 
         , pgp-wordlist     >= 0.1
-        , bytestring       >= 0.10
+        , bytestring
         , quickcheck-instances >= 0.3
         , tasty            >= 0.10
         , tasty-hunit      >= 0.9
@@ -148,6 +165,8 @@
     if !impl(ghc >= 8.0)
         build-depends: semigroups >= 0.6
 
+    if !flag(text)
+        buildable: False
 
 
 benchmark fusion
@@ -164,10 +183,13 @@
         , text
         , transformers   >= 0.3
         , ansi-wl-pprint >= 0.6
-    ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N
+    ghc-options: -Wall -rtsopts
     default-language: Haskell2010
     other-extensions: OverloadedStrings
 
+    if !flag(text)
+        buildable: False
+
 benchmark faster-unsafe-text
     build-depends:
           base >= 4.5 && < 5
@@ -178,10 +200,12 @@
 
     hs-source-dirs:      bench
     main-is:             FasterUnsafeText.hs
-    ghc-options:         -threaded -rtsopts -with-rtsopts=-N -Wall
+    ghc-options:         -rtsopts -Wall
     default-language:    Haskell2010
     type:                exitcode-stdio-1.0
 
+    if !flag(text)
+        buildable: False
 
 benchmark large-output
     build-depends:
@@ -198,7 +222,7 @@
 
     hs-source-dirs:      bench
     main-is:             LargeOutput.hs
-    ghc-options:         -threaded -rtsopts -with-rtsopts=-N -Wall
+    ghc-options:         -rtsopts -Wall
     default-language:    Haskell2010
     type:                exitcode-stdio-1.0
 
@@ -207,3 +231,6 @@
 
     if !impl(ghc >= 8.0)
         build-depends: semigroups
+
+    if !flag(text)
+        buildable: False
diff --git a/src-text/Data/Text.hs b/src-text/Data/Text.hs
new file mode 100644
--- /dev/null
+++ b/src-text/Data/Text.hs
@@ -0,0 +1,46 @@
+-- Provide a fake API, mimicking Data.Text from text package,
+-- but actually backed by type Text = String. It is used only in rare
+-- circumstances, when prettyprinter is built with -text flag.
+--
+
+{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
+
+module Data.Text where
+
+import Prelude hiding (head, length, null, replicate)
+import qualified Data.Char
+import qualified Data.List
+
+type Text = String
+cons = (:)
+dropWhileEnd = Data.List.dropWhileEnd
+head = Data.List.head
+intercalate = Data.List.intercalate
+length = Data.List.length :: [Char] -> Int
+lines = Data.List.lines
+map = Data.List.map
+null = Data.List.null :: [Char] -> Bool
+pack = id
+replicate = (Data.List.concat .) . Data.List.replicate
+singleton = (:[])
+snoc xs x = xs ++ [x]
+stripEnd = dropWhileEnd Data.Char.isSpace
+unlines = Data.List.unlines
+unpack = id
+words = Data.List.words
+
+uncons :: Text -> Maybe (Char, Text)
+uncons [] = Nothing
+uncons (x : xs) = Just (x, xs)
+
+splitOn :: Text -> Text -> [Text]
+splitOn pat src
+  | null pat = error "splitOn: empty pattern"
+  | otherwise = go [] src
+  where
+    go acc [] = [reverse acc]
+    go acc xs@(y : ys)
+      | pat `Data.List.isPrefixOf` xs
+      = reverse acc : go [] (drop (length pat) xs)
+      | otherwise
+      = go (y : acc) ys
diff --git a/src-text/Data/Text/IO.hs b/src-text/Data/Text/IO.hs
new file mode 100644
--- /dev/null
+++ b/src-text/Data/Text/IO.hs
@@ -0,0 +1,13 @@
+-- Provide a fake API, mimicking Data.Text.IO from text package,
+-- but actually backed by type Text = String. It is used only in rare
+-- circumstances, when prettyprinter is built with -text flag.
+--
+
+{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
+
+module Data.Text.IO where
+
+import qualified System.IO
+
+hPutStr = System.IO.hPutStr
+putStrLn = System.IO.putStrLn
diff --git a/src-text/Data/Text/Lazy.hs b/src-text/Data/Text/Lazy.hs
new file mode 100644
--- /dev/null
+++ b/src-text/Data/Text/Lazy.hs
@@ -0,0 +1,15 @@
+-- Provide a fake API, mimicking Data.Text.Lazy from text package,
+-- but actually backed by type Text = String. It is used only in rare
+-- circumstances, when prettyprinter is built with -text flag.
+--
+
+{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
+
+module Data.Text.Lazy where
+
+import Data.Text as T
+
+type Text = T.Text
+length = T.length
+lines = T.lines
+toStrict = id
diff --git a/src-text/Data/Text/Lazy/Builder.hs b/src-text/Data/Text/Lazy/Builder.hs
new file mode 100644
--- /dev/null
+++ b/src-text/Data/Text/Lazy/Builder.hs
@@ -0,0 +1,13 @@
+-- Provide a fake API, mimicking Data.Text.Lazy.Builder from text package,
+-- but actually backed by type Builder = String. It is used only in rare
+-- circumstances, when prettyprinter is built with -text flag.
+--
+
+{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
+
+module Data.Text.Lazy.Builder where
+
+type Builder = String
+fromText = id
+singleton = (:[])
+toLazyText = id
diff --git a/src/Data/Text/Prettyprint/Doc.hs b/src/Data/Text/Prettyprint/Doc.hs
--- a/src/Data/Text/Prettyprint/Doc.hs
+++ b/src/Data/Text/Prettyprint/Doc.hs
@@ -1,11 +1,4 @@
--- | This module is part of the old @Data.Text.Prettyprint.Doc@ module hierarchy
--- which is being replaced by a shallower @Prettyprinter@ module hierarchy
--- offering the same API.
---
--- This module will be deprecated and eventually removed.
---
--- Use "Prettyprinter" instead.
-module Data.Text.Prettyprint.Doc (
+module Data.Text.Prettyprint.Doc {-# DEPRECATED "Use \"Prettyprinter\" instead." #-} (
     module Prettyprinter
 ) where
 
diff --git a/src/Data/Text/Prettyprint/Doc/Internal.hs b/src/Data/Text/Prettyprint/Doc/Internal.hs
--- a/src/Data/Text/Prettyprint/Doc/Internal.hs
+++ b/src/Data/Text/Prettyprint/Doc/Internal.hs
@@ -1,11 +1,4 @@
--- | This module is part of the old @Data.Text.Prettyprint.Doc@ module hierarchy
--- which is being replaced by a shallower @Prettyprinter@ module hierarchy
--- offering the same API.
---
--- This module will be deprecated and eventually removed.
---
--- Use "Prettyprinter.Internal" instead.
-module Data.Text.Prettyprint.Doc.Internal (
+module Data.Text.Prettyprint.Doc.Internal {-# DEPRECATED "Use \"Prettyprinter.Internal\" instead." #-} (
     module Prettyprinter.Internal
 ) where
 
diff --git a/src/Data/Text/Prettyprint/Doc/Internal/Debug.hs b/src/Data/Text/Prettyprint/Doc/Internal/Debug.hs
--- a/src/Data/Text/Prettyprint/Doc/Internal/Debug.hs
+++ b/src/Data/Text/Prettyprint/Doc/Internal/Debug.hs
@@ -1,11 +1,4 @@
--- | This module is part of the old @Data.Text.Prettyprint.Doc@ module hierarchy
--- which is being replaced by a shallower @Prettyprinter@ module hierarchy
--- offering the same API.
---
--- This module will be deprecated and eventually removed.
---
--- Use "Prettyprinter.Internal.Debug" instead.
-module Data.Text.Prettyprint.Doc.Internal.Debug (
+module Data.Text.Prettyprint.Doc.Internal.Debug {-# DEPRECATED "Use \"Prettyprinter.Internal.Debug\" instead." #-} (
     module Prettyprinter.Internal.Debug
 ) where
 
diff --git a/src/Data/Text/Prettyprint/Doc/Internal/Type.hs b/src/Data/Text/Prettyprint/Doc/Internal/Type.hs
--- a/src/Data/Text/Prettyprint/Doc/Internal/Type.hs
+++ b/src/Data/Text/Prettyprint/Doc/Internal/Type.hs
@@ -1,11 +1,4 @@
--- | This module is part of the old @Data.Text.Prettyprint.Doc@ module hierarchy
--- which is being replaced by a shallower @Prettyprinter@ module hierarchy
--- offering the same API.
---
--- This module will be deprecated and eventually removed.
---
--- Use "Prettyprinter.Internal.Type" instead.
-module Data.Text.Prettyprint.Doc.Internal.Type (
+module Data.Text.Prettyprint.Doc.Internal.Type {-# DEPRECATED "Use \"Prettyprinter.Internal.Type\" instead." #-} (
     module Prettyprinter.Internal.Type
 ) where
 
diff --git a/src/Data/Text/Prettyprint/Doc/Render/String.hs b/src/Data/Text/Prettyprint/Doc/Render/String.hs
--- a/src/Data/Text/Prettyprint/Doc/Render/String.hs
+++ b/src/Data/Text/Prettyprint/Doc/Render/String.hs
@@ -1,11 +1,4 @@
--- | This module is part of the old @Data.Text.Prettyprint.Doc@ module hierarchy
--- which is being replaced by a shallower @Prettyprinter@ module hierarchy
--- offering the same API.
---
--- This module will be deprecated and eventually removed.
---
--- Use "Prettyprinter.Render.String" instead.
-module Data.Text.Prettyprint.Doc.Render.String (
+module Data.Text.Prettyprint.Doc.Render.String {-# DEPRECATED "Use \"Prettyprinter.Render.String\" instead." #-} (
     module Prettyprinter.Render.String
 ) where
 
diff --git a/src/Data/Text/Prettyprint/Doc/Render/Text.hs b/src/Data/Text/Prettyprint/Doc/Render/Text.hs
--- a/src/Data/Text/Prettyprint/Doc/Render/Text.hs
+++ b/src/Data/Text/Prettyprint/Doc/Render/Text.hs
@@ -1,11 +1,4 @@
--- | This module is part of the old @Data.Text.Prettyprint.Doc@ module hierarchy
--- which is being replaced by a shallower @Prettyprinter@ module hierarchy
--- offering the same API.
---
--- This module will be deprecated and eventually removed.
---
--- Use "Prettyprinter.Render.Text" instead.
-module Data.Text.Prettyprint.Doc.Render.Text (
+module Data.Text.Prettyprint.Doc.Render.Text {-# DEPRECATED "Use \"Prettyprinter.Render.Text\" instead." #-} (
     module Prettyprinter.Render.Text
 ) where
 
diff --git a/src/Data/Text/Prettyprint/Doc/Render/Tutorials/StackMachineTutorial.hs b/src/Data/Text/Prettyprint/Doc/Render/Tutorials/StackMachineTutorial.hs
--- a/src/Data/Text/Prettyprint/Doc/Render/Tutorials/StackMachineTutorial.hs
+++ b/src/Data/Text/Prettyprint/Doc/Render/Tutorials/StackMachineTutorial.hs
@@ -1,11 +1,4 @@
--- | This module is part of the old @Data.Text.Prettyprint.Doc@ module hierarchy
--- which is being replaced by a shallower @Prettyprinter@ module hierarchy
--- offering the same API.
---
--- This module will be deprecated and eventually removed.
---
--- Use "Prettyprinter.Render.Tutorials.StackMachineTutorial" instead.
-module Data.Text.Prettyprint.Doc.Render.Tutorials.StackMachineTutorial (
+module Data.Text.Prettyprint.Doc.Render.Tutorials.StackMachineTutorial {-# DEPRECATED "Use \"Prettyprinter.Render.Tutorials.StackMachineTutorial\" instead." #-} (
     module Prettyprinter.Render.Tutorials.StackMachineTutorial
 ) where
 
diff --git a/src/Data/Text/Prettyprint/Doc/Render/Tutorials/TreeRenderingTutorial.hs b/src/Data/Text/Prettyprint/Doc/Render/Tutorials/TreeRenderingTutorial.hs
--- a/src/Data/Text/Prettyprint/Doc/Render/Tutorials/TreeRenderingTutorial.hs
+++ b/src/Data/Text/Prettyprint/Doc/Render/Tutorials/TreeRenderingTutorial.hs
@@ -1,11 +1,4 @@
--- | This module is part of the old @Data.Text.Prettyprint.Doc@ module hierarchy
--- which is being replaced by a shallower @Prettyprinter@ module hierarchy
--- offering the same API.
---
--- This module will be deprecated and eventually removed.
---
--- Use "Prettyprinter.Render.Tutorials.TreeRenderingTutorial" instead.
-module Data.Text.Prettyprint.Doc.Render.Tutorials.TreeRenderingTutorial (
+module Data.Text.Prettyprint.Doc.Render.Tutorials.TreeRenderingTutorial {-# DEPRECATED "Use \"Prettyprinter.Render.Tutorials.TreeRenderingTutorial\" instead." #-} (
     module Prettyprinter.Render.Tutorials.TreeRenderingTutorial
 ) where
 
diff --git a/src/Data/Text/Prettyprint/Doc/Render/Util/Panic.hs b/src/Data/Text/Prettyprint/Doc/Render/Util/Panic.hs
--- a/src/Data/Text/Prettyprint/Doc/Render/Util/Panic.hs
+++ b/src/Data/Text/Prettyprint/Doc/Render/Util/Panic.hs
@@ -1,11 +1,4 @@
--- | This module is part of the old @Data.Text.Prettyprint.Doc@ module hierarchy
--- which is being replaced by a shallower @Prettyprinter@ module hierarchy
--- offering the same API.
---
--- This module will be deprecated and eventually removed.
---
--- Use "Prettyprinter.Render.Util.Panic" instead.
-module Data.Text.Prettyprint.Doc.Render.Util.Panic (
+module Data.Text.Prettyprint.Doc.Render.Util.Panic {-# DEPRECATED "Use \"Prettyprinter.Render.Util.Panic\" instead." #-} (
     module Prettyprinter.Render.Util.Panic
 ) where
 
diff --git a/src/Data/Text/Prettyprint/Doc/Render/Util/SimpleDocTree.hs b/src/Data/Text/Prettyprint/Doc/Render/Util/SimpleDocTree.hs
--- a/src/Data/Text/Prettyprint/Doc/Render/Util/SimpleDocTree.hs
+++ b/src/Data/Text/Prettyprint/Doc/Render/Util/SimpleDocTree.hs
@@ -1,11 +1,4 @@
--- | This module is part of the old @Data.Text.Prettyprint.Doc@ module hierarchy
--- which is being replaced by a shallower @Prettyprinter@ module hierarchy
--- offering the same API.
---
--- This module will be deprecated and eventually removed.
---
--- Use "Prettyprinter.Render.Util.SimpleDocTree" instead.
-module Data.Text.Prettyprint.Doc.Render.Util.SimpleDocTree (
+module Data.Text.Prettyprint.Doc.Render.Util.SimpleDocTree {-# DEPRECATED "Use \"Prettyprinter.Render.Util.SimpleDocTree\" instead." #-} (
     module Prettyprinter.Render.Util.SimpleDocTree
 ) where
 
diff --git a/src/Data/Text/Prettyprint/Doc/Render/Util/StackMachine.hs b/src/Data/Text/Prettyprint/Doc/Render/Util/StackMachine.hs
--- a/src/Data/Text/Prettyprint/Doc/Render/Util/StackMachine.hs
+++ b/src/Data/Text/Prettyprint/Doc/Render/Util/StackMachine.hs
@@ -1,11 +1,4 @@
--- | This module is part of the old @Data.Text.Prettyprint.Doc@ module hierarchy
--- which is being replaced by a shallower @Prettyprinter@ module hierarchy
--- offering the same API.
---
--- This module will be deprecated and eventually removed.
---
--- Use "Prettyprinter.Render.Util.StackMachine" instead.
-module Data.Text.Prettyprint.Doc.Render.Util.StackMachine (
+module Data.Text.Prettyprint.Doc.Render.Util.StackMachine {-# DEPRECATED "Use \"Prettyprinter.Render.Util.StackMachine\" instead." #-} (
     module Prettyprinter.Render.Util.StackMachine
 ) where
 
diff --git a/src/Data/Text/Prettyprint/Doc/Symbols/Ascii.hs b/src/Data/Text/Prettyprint/Doc/Symbols/Ascii.hs
--- a/src/Data/Text/Prettyprint/Doc/Symbols/Ascii.hs
+++ b/src/Data/Text/Prettyprint/Doc/Symbols/Ascii.hs
@@ -1,11 +1,4 @@
--- | This module is part of the old @Data.Text.Prettyprint.Doc@ module hierarchy
--- which is being replaced by a shallower @Prettyprinter@ module hierarchy
--- offering the same API.
---
--- This module will be deprecated and eventually removed.
---
--- Use "Prettyprinter.Symbols.Ascii" instead.
-module Data.Text.Prettyprint.Doc.Symbols.Ascii (
+module Data.Text.Prettyprint.Doc.Symbols.Ascii {-# DEPRECATED "Use \"Prettyprinter.Symbols.Ascii\" instead." #-} (
     module Prettyprinter.Symbols.Ascii
 ) where
 
diff --git a/src/Data/Text/Prettyprint/Doc/Symbols/Unicode.hs b/src/Data/Text/Prettyprint/Doc/Symbols/Unicode.hs
--- a/src/Data/Text/Prettyprint/Doc/Symbols/Unicode.hs
+++ b/src/Data/Text/Prettyprint/Doc/Symbols/Unicode.hs
@@ -1,11 +1,4 @@
--- | This module is part of the old @Data.Text.Prettyprint.Doc@ module hierarchy
--- which is being replaced by a shallower @Prettyprinter@ module hierarchy
--- offering the same API.
---
--- This module will be deprecated and eventually removed.
---
--- Use "Prettyprinter.Symbols.Unicode" instead.
-module Data.Text.Prettyprint.Doc.Symbols.Unicode (
+module Data.Text.Prettyprint.Doc.Symbols.Unicode {-# DEPRECATED "Use \"Prettyprinter.Symbols.Unicode\" instead." #-} (
     module Prettyprinter.Symbols.Unicode
 ) where
 
diff --git a/src/Data/Text/Prettyprint/Doc/Util.hs b/src/Data/Text/Prettyprint/Doc/Util.hs
--- a/src/Data/Text/Prettyprint/Doc/Util.hs
+++ b/src/Data/Text/Prettyprint/Doc/Util.hs
@@ -1,11 +1,4 @@
--- | This module is part of the old @Data.Text.Prettyprint.Doc@ module hierarchy
--- which is being replaced by a shallower @Prettyprinter@ module hierarchy
--- offering the same API.
---
--- This module will be deprecated and eventually removed.
---
--- Use "Prettyprinter.Util" instead.
-module Data.Text.Prettyprint.Doc.Util (
+module Data.Text.Prettyprint.Doc.Util {-# DEPRECATED "Use \"Prettyprinter.Util\" instead." #-} (
     module Prettyprinter.Util
 ) where
 
diff --git a/src/Prettyprinter.hs b/src/Prettyprinter.hs
--- a/src/Prettyprinter.hs
+++ b/src/Prettyprinter.hs
@@ -38,7 +38,10 @@
 -- Let’s prettyprint a simple Haskell type definition. First, intersperse @->@
 -- and add a leading @::@,
 --
--- >>> let prettyType = align . sep . zipWith (<+>) ("::" : repeat "->")
+-- >>> :{
+-- >>> prettyprintType :: [Doc x] -> Doc x
+-- >>> prettyprintType = align . sep . zipWith (<+>) ("::" : repeat "->")
+-- >>> :}
 --
 -- The 'sep' function is one way of concatenating documents, there are multiple
 -- others, e.g. 'vsep', 'cat' and 'fillSep'. In our case, 'sep' space-separates
@@ -47,11 +50,11 @@
 --
 -- Second, prepend the name to the type,
 --
--- >>> let prettyDecl n tys = pretty n <+> prettyType tys
+-- >>> let prettyprintDeclaration n tys = pretty n <+> prettyprintType tys
 --
 -- Now we can define a document that contains some type signature:
 --
--- >>> let doc = prettyDecl "example" ["Int", "Bool", "Char", "IO ()"]
+-- >>> let doc = prettyprintDeclaration "example" ["Int", "Bool", "Char", "IO ()"]
 --
 -- This document can now be printed, and it automatically adapts to available
 -- space. If the page is wide enough (80 characters in this case), the
diff --git a/src/Prettyprinter/Internal.hs b/src/Prettyprinter/Internal.hs
--- a/src/Prettyprinter/Internal.hs
+++ b/src/Prettyprinter/Internal.hs
@@ -315,7 +315,7 @@
 -- | >>> pretty ()
 -- ()
 --
--- The argument is not used,
+-- The argument is not used:
 --
 -- >>> pretty (error "Strict?" :: ())
 -- ()
@@ -339,7 +339,11 @@
     pretty '\n' = line
     pretty c = Char c
 
+#ifdef MIN_VERSION_text
     prettyList = pretty . (id :: Text -> Text) . fromString
+#else
+    prettyList = vsep . map unsafeTextWithoutNewlines . T.splitOn "\n"
+#endif
 
 -- | Convenience function to convert a 'Show'able value to a 'Doc'. If the
 -- 'String' does not contain newlines, consider using the more performant
@@ -435,6 +439,7 @@
     pretty = maybe mempty pretty
     prettyList = prettyList . catMaybes
 
+#ifdef MIN_VERSION_text
 -- | Automatically converts all newlines to @'line'@.
 --
 -- >>> pretty ("hello\nworld" :: Text)
@@ -451,6 +456,7 @@
 
 -- | (lazy 'Text' instance, identical to the strict version)
 instance Pretty Lazy.Text where pretty = pretty . Lazy.toStrict
+#endif
 
 -- | Finding a good example for printing something that does not exist is hard,
 -- so here is an example of printing a list full of nothing.
@@ -732,13 +738,13 @@
 -- >>> let prettyDo xs = group ("do" <+> align (encloseSep open close separator xs))
 -- >>> let statements  = ["name:_ <- getArgs", "let greet = \"Hello, \" <> name", "putStrLn greet"]
 --
--- This is put into a single line with @{;}@ style if it fits,
+-- This is put into a single line with @{;}@ style if it fits:
 --
 -- >>> putDocW 80 (prettyDo statements)
 -- do { name:_ <- getArgs; let greet = "Hello, " <> name; putStrLn greet }
 --
 -- When there is not enough space the statements are broken up into lines
--- nicely,
+-- nicely:
 --
 -- >>> putDocW 10 (prettyDo statements)
 -- do name:_ <- getArgs
@@ -778,14 +784,14 @@
 --
 -- As an example, we will put a document right above another one, regardless of
 -- the current nesting level. Without 'align'ment, the second line is put simply
--- below everything we've had so far,
+-- below everything we've had so far:
 --
 -- >>> "lorem" <+> vsep ["ipsum", "dolor"]
 -- lorem ipsum
 -- dolor
 --
 -- If we add an 'align' to the mix, the @'vsep'@'s contents all start in the
--- same column,
+-- same column:
 --
 -- >>> "lorem" <+> align (vsep ["ipsum", "dolor"])
 -- lorem ipsum
@@ -843,7 +849,7 @@
 -- | @('encloseSep' l r sep xs)@ concatenates the documents @xs@ separated by
 -- @sep@, and encloses the resulting document by @l@ and @r@.
 --
--- The documents are laid out horizontally if that fits the page,
+-- The documents are laid out horizontally if that fits the page:
 --
 -- >>> let doc = "list" <+> align (encloseSep lbracket rbracket comma (map pretty [1,20,300,4000]))
 -- >>> putDocW 80 doc
@@ -934,15 +940,15 @@
 -- 'concatWith' (**) [x,y,z] = x ** y ** z
 -- @
 --
--- Multiple convenience definitions based on 'concatWith' are alredy predefined,
--- for example
+-- Multiple convenience definitions based on 'concatWith' are already predefined,
+-- for example:
 --
 -- @
 -- 'hsep'    = 'concatWith' ('<+>')
 -- 'fillSep' = 'concatWith' (\\x y -> x '<>' 'softline' '<>' y)
 -- @
 --
--- This is also useful to define customized joiners,
+-- This is also useful to define customized joiners:
 --
 -- >>> concatWith (surround dot) ["Prettyprinter", "Render", "Text"]
 -- Prettyprinter.Render.Text
@@ -1092,7 +1098,7 @@
 -- instead of newlines. See 'fillSep' if you want a 'space' instead.)
 --
 -- Observe the difference between 'fillSep' and 'fillCat'. 'fillSep'
--- concatenates the entries 'space'd when 'group'ed,
+-- concatenates the entries 'space'd when 'group'ed:
 --
 -- >>> let docs = take 20 (cycle (["lorem", "ipsum", "dolor", "sit", "amet"]))
 -- >>> putDocW 40 ("Grouped:" <+> group (fillSep docs))
@@ -1102,7 +1108,7 @@
 -- amet
 --
 -- On the other hand, 'fillCat' concatenates the entries directly when
--- 'group'ed,
+-- 'group'ed:
 --
 -- >>> putDocW 40 ("Grouped:" <+> group (fillCat docs))
 -- Grouped: loremipsumdolorsitametlorem
@@ -1120,7 +1126,7 @@
 -- >>> putDocW 80 ("Docs:" <+> cat docs)
 -- Docs: loremipsumdolor
 --
--- When there is enough space, the documents are put above one another,
+-- When there is enough space, the documents are put above one another:
 --
 -- >>> putDocW 10 ("Docs:" <+> cat docs)
 -- Docs: lorem
@@ -1364,7 +1370,7 @@
 -- | Change the annotation of a 'Doc'ument.
 --
 -- Useful in particular to embed documents with one form of annotation in a more
--- generlly annotated document.
+-- generally annotated document.
 --
 -- Since this traverses the entire @'Doc'@ tree, including parts that are not
 -- rendered due to other layouts fitting better, it is preferrable to reannotate
@@ -1511,7 +1517,7 @@
 -- which is only a single 'SimpleDocStream' entry, and can be processed faster.
 --
 -- It is therefore a good idea to run 'fuse' on concatenations of lots of small
--- strings that are used many times,
+-- strings that are used many times:
 --
 -- >>> let oftenUsed = fuse Shallow ("a" <> "b" <> pretty 'c' <> "d")
 -- >>> hsep (replicate 5 oftenUsed)
@@ -1844,7 +1850,7 @@
 -- >>> let doc = (fun . fun . fun . fun . fun) (align (list ["abcdef", "ghijklm"]))
 --
 -- which we’ll be rendering using the following pipeline (where the layout
--- algorithm has been left open),
+-- algorithm has been left open):
 --
 -- >>> import Data.Text.IO as T
 -- >>> import Prettyprinter.Render.Text
@@ -1853,7 +1859,7 @@
 --
 -- If we render this using 'layoutPretty' with a page width of 26 characters
 -- per line, all the @fun@ calls fit into the first line so they will be put
--- there,
+-- there:
 --
 -- >>> go layoutPretty doc
 -- |------------------------|
diff --git a/src/Prettyprinter/Render/Text.hs b/src/Prettyprinter/Render/Text.hs
--- a/src/Prettyprinter/Render/Text.hs
+++ b/src/Prettyprinter/Render/Text.hs
@@ -1,12 +1,13 @@
 {-# LANGUAGE CPP               #-}
-{-# LANGUAGE OverloadedStrings #-}
 
 #include "version-compatibility-macros.h"
 
 -- | Render an unannotated 'SimpleDocStream' as plain 'Text'.
 module Prettyprinter.Render.Text (
+#ifdef MIN_VERSION_text
     -- * Conversion to plain 'Text'
     renderLazy, renderStrict,
+#endif
 
     -- * Render to a 'Handle'
     renderIO,
diff --git a/src/Prettyprinter/Render/Util/SimpleDocTree.hs b/src/Prettyprinter/Render/Util/SimpleDocTree.hs
--- a/src/Prettyprinter/Render/Util/SimpleDocTree.hs
+++ b/src/Prettyprinter/Render/Util/SimpleDocTree.hs
@@ -1,7 +1,6 @@
 {-# LANGUAGE CPP                #-}
 {-# LANGUAGE DeriveDataTypeable #-}
 {-# LANGUAGE DeriveGeneric      #-}
-{-# LANGUAGE OverloadedStrings  #-}
 
 #include "version-compatibility-macros.h"
 
diff --git a/test/Testsuite/Main.hs b/test/Testsuite/Main.hs
--- a/test/Testsuite/Main.hs
+++ b/test/Testsuite/Main.hs
@@ -15,10 +15,10 @@
 import           Data.Word
 import           System.Timeout        (timeout)
 
-import           Data.Text.Prettyprint.Doc
-import           Data.Text.Prettyprint.Doc.Internal.Debug
-import           Data.Text.Prettyprint.Doc.Render.Text
-import           Data.Text.Prettyprint.Doc.Render.Util.StackMachine (renderSimplyDecorated)
+import           Prettyprinter
+import           Prettyprinter.Internal.Debug
+import           Prettyprinter.Render.Text
+import           Prettyprinter.Render.Util.StackMachine (renderSimplyDecorated)
 
 import Test.QuickCheck.Instances.Text ()
 import Test.Tasty
diff --git a/test/Testsuite/StripTrailingSpace.hs b/test/Testsuite/StripTrailingSpace.hs
--- a/test/Testsuite/StripTrailingSpace.hs
+++ b/test/Testsuite/StripTrailingSpace.hs
@@ -10,8 +10,8 @@
 import           Data.Text (Text)
 import qualified Data.Text as T
 
-import Data.Text.Prettyprint.Doc
-import Data.Text.Prettyprint.Doc.Render.Util.StackMachine
+import Prettyprinter
+import Prettyprinter.Render.Util.StackMachine
 
 import Test.Tasty
 import Test.Tasty.HUnit
