wl-pprint-text 1.1.1.1 → 1.2.0.0
raw patch · 4 files changed
+34/−22 lines, 4 files
Files
- Changelog.md +15/−0
- Text/PrettyPrint/Leijen/Text.hs +8/−3
- Text/PrettyPrint/Leijen/Text/Monadic.hs +10/−18
- wl-pprint-text.cabal +1/−1
Changelog.md view
@@ -1,3 +1,18 @@+1.2.0.0 (2018-05-07)+====================++* Remove `IsString (m Doc)` instance (#16).++* Export the `beside` function from both modules.++ - For non-Monadic pretty-printing this is identical to the+ Semigroup/Monoid `<>` combinator.++ - For Monadic pretty-printing this is the lifted version of `<>`.++* No longer export `<>`. Use `beside` instead, or the+ Semigroup/Monoid instance (for non-Monadic).+ 1.1.1.1 (2018-04-13) ====================
Text/PrettyPrint/Leijen/Text.hs view
@@ -70,7 +70,7 @@ Doc, -- * Basic combinators- empty, isEmpty, char, text, textStrict, (<>), nest, line, linebreak, group,+ empty, isEmpty, char, text, textStrict, beside, nest, line, linebreak, group, softline, softbreak, spacebreak, -- * Alignment@@ -140,7 +140,7 @@ #endif infixr 5 </>,<//>,<$>,<$$>-infixr 6 <+>,<++>+infixr 6 <+>,<++>,`beside` -----------------------------------------------------------@@ -844,6 +844,11 @@ linebreak :: Doc linebreak = Line True +-- | The document @(x `beside` y)@ concatenates document @x@ and @y@.+-- It is an associative operation having 'empty' as a left and right+-- unit. (infixr 6)+--+-- It is equivalent to `<>`. beside :: Doc -> Doc -> Doc beside Empty r = r beside l Empty = l@@ -950,7 +955,7 @@ wth = min (w64 - k) (r - k + n) fits :: Int64 -> SimpleDoc -> Bool-fits w _ | w < 0 = False+fits w _ | w < 0 = False fits _ SEmpty = True fits w (SChar _ x) = fits (w - 1) x fits w (SText l _ x) = fits (w - l) x
Text/PrettyPrint/Leijen/Text/Monadic.hs view
@@ -21,7 +21,7 @@ Doc, -- putDoc, hPutDoc, -- * Basic combinators- empty, char, text, textStrict, (<>), nest, line, linebreak, group, softline,+ empty, char, text, textStrict, beside, nest, line, linebreak, group, softline, softbreak, spacebreak, -- * Alignment@@ -71,11 +71,7 @@ import Prelude () -#if MIN_VERSION_base (4,9,0)-import Prelude.Compat hiding ((<$>), (<>))-#else import Prelude.Compat hiding ((<$>))-#endif import Text.PrettyPrint.Leijen.Text (Doc, Pretty(..), SimpleDoc(..), displayB, displayIO, displayT,@@ -85,15 +81,11 @@ import qualified Text.PrettyPrint.Leijen.Text as PP import Control.Applicative (liftA2, liftA3)-import Data.String (IsString(..)) import qualified Data.Text as TS import Data.Text.Lazy (Text) infixr 5 </>,<//>,<$>,<$$>-infixr 6 <>,<+>,<++>--instance (Applicative m) => IsString (m Doc) where- fromString = string . fromString+infixr 6 <+>,<++>,`beside` ----------------------------------------------------------- @@ -256,11 +248,11 @@ vcat :: (Functor m) => m [Doc] -> m Doc vcat = fmap PP.vcat --- | The document @(x \<\> y)@ concatenates document @x@ and document--- @y@. It is an associative operation having 'empty' as a left and--- right unit. (infixr 6)-(<>) :: (Applicative m) => m Doc -> m Doc -> m Doc-(<>) = liftA2 (PP.<>)+-- | The document @(x `beside` y)@ concatenates document @x@ and+-- document @y@. It is an associative operation having 'empty' as a+-- left and right unit. (infixr 6)+beside :: (Applicative m) => m Doc -> m Doc -> m Doc+beside = liftA2 (PP.beside) -- | The document @(x \<+\> y)@ concatenates document @x@ and @y@ with -- a 'space' in between. (infixr 6)@@ -342,9 +334,9 @@ brackets = fmap PP.brackets -- | The document @(enclose l r x)@ encloses document @x@ between--- documents @l@ and @r@ using @(\<\>)@.+-- documents @l@ and @r@ using @'beside'@. ----- > enclose l r x = l <> x <> r+-- > enclose l r x = l `beside` x `beside` r enclose :: (Applicative m) => m Doc -> m Doc -> m Doc -> m Doc enclose = liftA3 PP.enclose @@ -402,7 +394,7 @@ -- | The document @space@ contains a single space, \" \". ----- > x <+> y = x <> space <> y+-- > x <+> y = x `beside` space `beside` y space :: (Applicative m) => m Doc space = pure PP.space
wl-pprint-text.cabal view
@@ -1,5 +1,5 @@ Name: wl-pprint-text-Version: 1.1.1.1+Version: 1.2.0.0 Synopsis: A Wadler/Leijen Pretty Printer for Text values Description: A clone of wl-pprint for use with the text library. License: BSD3