Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate the Data.Text.Prettyprint.* modules #203

Merged
merged 6 commits into from
Sep 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ library
base >= 4.5 && < 5
, ansi-terminal >= 0.4.0
, text >= 1.2
, prettyprinter >= 1.1.1
, prettyprinter >= 1.7.0

if impl(ghc >= 8.0)
ghc-options: -Wcompat
Expand Down
Original file line number Diff line number Diff line change
@@ -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.Terminal" instead.
module Data.Text.Prettyprint.Doc.Render.Terminal (
module Data.Text.Prettyprint.Doc.Render.Terminal {-# DEPRECATED "Use \"Prettyprinter.Render.Terminal\" instead." #-} (
module Prettyprinter.Render.Terminal
) where

Expand Down
Original file line number Diff line number Diff line change
@@ -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.Terminal.Internal" instead.
module Data.Text.Prettyprint.Doc.Render.Terminal.Internal (
module Data.Text.Prettyprint.Doc.Render.Terminal.Internal {-# DEPRECATED "Use \"Prettyprinter.Render.Terminal.Internal\" instead." #-} (
module Prettyprinter.Render.Terminal.Internal
) where

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ import qualified Data.Text.Lazy.Builder as TLB
import qualified System.Console.ANSI as ANSI
import System.IO (Handle, hPutChar, stdout)

import Data.Text.Prettyprint.Doc
import Data.Text.Prettyprint.Doc.Render.Util.Panic
import Prettyprinter
import Prettyprinter.Render.Util.Panic

#if !(SEMIGROUP_MONOID_SUPERCLASS)
import Data.Semigroup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ library
build-depends:
base >= 4.5 && < 5 && < 5
, text >= 1.2
, prettyprinter >= 1
, prettyprinter >= 1.7.0
, prettyprinter-ansi-terminal >= 1.1

if !impl(ghc >= 8.0)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{-# LANGUAGE CPP #-}

module Text.PrettyPrint.ANSI.Leijen {-# DEPRECATED "Compatibility module for users of ansi-wl-pprint - use Data.Text.Prettyprint.Doc instead" #-} (
module Text.PrettyPrint.ANSI.Leijen {-# DEPRECATED "Compatibility module for users of ansi-wl-pprint - use \"Prettyprinter\" instead" #-} (

Doc, putDoc, hPutDoc, empty, char, text, (<>), nest, line, linebreak, group,
softline, softbreak, hardline, flatAlt, renderSmart, align, hang, indent,
Expand Down Expand Up @@ -28,9 +28,9 @@ import Prelude
import qualified Data.Text.Lazy as TL
import System.IO

import Data.Text.Prettyprint.Doc (Pretty (..))
import qualified Data.Text.Prettyprint.Doc as New
import qualified Data.Text.Prettyprint.Doc.Render.Terminal as NewT
import Prettyprinter (Pretty (..))
import qualified Prettyprinter as New
import qualified Prettyprinter.Render.Terminal as NewT

#if !(MIN_VERSION_base(4,11,0))
import Data.Semigroup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ library
build-depends:
base >= 4.5 && < 5
, text >= 1.2
, prettyprinter >= 1
, prettyprinter >= 1.7.0

if !impl(ghc >= 8.0)
build-depends: semigroups >= 0.1
8 changes: 4 additions & 4 deletions prettyprinter-compat-wl-pprint/src/Text/PrettyPrint/Leijen.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{-# LANGUAGE CPP #-}

module Text.PrettyPrint.Leijen {-# DEPRECATED "Compatibility module for users of wl-pprint - use Data.Text.Prettyprint.Doc instead" #-} (
module Text.PrettyPrint.Leijen {-# DEPRECATED "Compatibility module for users of wl-pprint - use \"Prettyprinter\" instead" #-} (

Doc, putDoc, hPutDoc, empty, char, text, (<>), nest, line, linebreak, group,
softline, softbreak, align, hang, indent, encloseSep, list, tupled,
Expand All @@ -25,9 +25,9 @@ import Prelude
import qualified Data.Text.Lazy as TL
import System.IO

import Data.Text.Prettyprint.Doc (Pretty (..))
import qualified Data.Text.Prettyprint.Doc as New
import qualified Data.Text.Prettyprint.Doc.Render.Text as NewT
import Prettyprinter (Pretty (..))
import qualified Prettyprinter as New
import qualified Prettyprinter.Render.Text as NewT

#if !(MIN_VERSION_base(4,11,0))
import Data.Semigroup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ library
build-depends:
base >= 4.5 && < 5
, text >= 1.2
, prettyprinter >= 1
, prettyprinter >= 1.7.0
, prettyprinter-ansi-terminal >= 1.1.1
, ansi-wl-pprint >= 0.6.8
, ansi-terminal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
-- | This module is part of the old @Data.Text.Prettyprint@ 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.Convert.AnsiWlPprint" instead.
module Data.Text.Prettyprint.Convert.AnsiWlPprint (
module Data.Text.Prettyprint.Convert.AnsiWlPprint {-# DEPRECATED "Use \"Prettyprinter.Convert.AnsiWlPprint\" instead." #-} (
module Prettyprinter.Convert.AnsiWlPprint
) where

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ module Prettyprinter.Convert.AnsiWlPprint (

import qualified Data.Text as T

import qualified Data.Text.Prettyprint.Doc.Internal as New
import qualified Data.Text.Prettyprint.Doc.Render.Terminal.Internal as NewTerm
import qualified System.Console.ANSI as Ansi
import qualified Text.PrettyPrint.ANSI.Leijen.Internal as Old
import qualified Prettyprinter.Internal as New
import qualified Prettyprinter.Render.Terminal.Internal as NewTerm
import qualified System.Console.ANSI as Ansi
import qualified Text.PrettyPrint.ANSI.Leijen.Internal as Old



Expand Down
4 changes: 2 additions & 2 deletions prettyprinter/app/GenerateReadme.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import qualified Data.List as L
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

Expand Down
6 changes: 3 additions & 3 deletions prettyprinter/bench/FasterUnsafeText.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ module Main (main) where

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



Expand Down
6 changes: 3 additions & 3 deletions prettyprinter/bench/Fusion.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import Data.Text (Text)
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
Expand Down
4 changes: 2 additions & 2 deletions prettyprinter/bench/LargeOutput.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import Data.Text (Text)
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
Expand Down
9 changes: 1 addition & 8 deletions prettyprinter/src/Data/Text/Prettyprint/Doc.hs
Original file line number Diff line number Diff line change
@@ -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

Expand Down
9 changes: 1 addition & 8 deletions prettyprinter/src/Data/Text/Prettyprint/Doc/Internal.hs
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
9 changes: 1 addition & 8 deletions prettyprinter/src/Data/Text/Prettyprint/Doc/Internal/Type.hs
Original file line number Diff line number Diff line change
@@ -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

Expand Down
9 changes: 1 addition & 8 deletions prettyprinter/src/Data/Text/Prettyprint/Doc/Render/String.hs
Original file line number Diff line number Diff line change
@@ -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

Expand Down
9 changes: 1 addition & 8 deletions prettyprinter/src/Data/Text/Prettyprint/Doc/Render/Text.hs
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
9 changes: 1 addition & 8 deletions prettyprinter/src/Data/Text/Prettyprint/Doc/Symbols/Ascii.hs
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
9 changes: 1 addition & 8 deletions prettyprinter/src/Data/Text/Prettyprint/Doc/Util.hs
Original file line number Diff line number Diff line change
@@ -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

Expand Down
8 changes: 4 additions & 4 deletions prettyprinter/test/Testsuite/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import Data.Text.PgpWordlist
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
Expand Down
4 changes: 2 additions & 2 deletions prettyprinter/test/Testsuite/StripTrailingSpace.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ module StripTrailingSpace (testStripTrailingSpace) where
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
Expand Down