packages feed

wl-pprint-extras 3.5 → 3.5.0.2

raw patch · 2 files changed

+12/−3 lines, 2 filesdep ~text

Dependency ranges changed: text

Files

src/Text/PrettyPrint/Free/Internal.hs view
@@ -1,4 +1,3 @@-{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-} ----------------------------------------------------------------------------- -- | -- Module      :  Text.PrettyPrint.Free.Internal@@ -751,10 +750,12 @@   | Ribbon  (Int -> Doc e)  instance Functor Doc where+  fmap _ Fail = Fail   fmap _ Empty = Empty   fmap _ (Char c) = Char c   fmap _  Line = Line   fmap _ (Text i s) = Text i s+  fmap f (FlatAlt l r) = FlatAlt (fmap f l) (fmap f r)   fmap f (Cat l r) = Cat (fmap f l) (fmap f r)   fmap f (Nest i d) = Nest i (fmap f d)   fmap f (Union l r) = Union (fmap f l) (fmap f r)@@ -776,10 +777,12 @@  instance Monad Doc where   return = Effect+  Fail >>= _ = Fail   Empty >>= _ = Empty   Char c >>= _ = Char c   Text i s >>= _ = Text i s   Line >>= _ = Line+  FlatAlt l r >>= k = FlatAlt (l >>= k) (r >>= k)   Cat l r >>= k = Cat (l >>= k) (r >>= k)   Nest i d >>= k = Nest i (d >>= k)   Union l r >>= k = Union (l >>= k) (r >>= k)@@ -824,6 +827,7 @@   | SEffect e (SimpleDoc e)  instance Functor SimpleDoc where+  fmap _ SFail = SFail   fmap _ SEmpty = SEmpty   fmap f (SChar c d) = SChar c (fmap f d)   fmap f (SText i s d) = SText i s (fmap f d)@@ -831,6 +835,7 @@   fmap f (SEffect e d) = SEffect (f e) (fmap f d)  instance Foldable SimpleDoc where+  foldMap _ SFail = mempty   foldMap _ SEmpty = mempty   foldMap f (SChar _ d) = foldMap f d   foldMap f (SText _ _ d) = foldMap f d@@ -838,6 +843,7 @@   foldMap f (SEffect e d) = f e `mappend` foldMap f d  instance Traversable SimpleDoc where+  traverse _ SFail = pure SFail   traverse _ SEmpty = pure SEmpty   traverse f (SChar c d) = SChar c <$> traverse f d   traverse f (SText i s d) = SText i s <$> traverse f d@@ -1045,6 +1051,7 @@         fits m w (SChar _ x)      = fits m (w - 1) x         fits m w (SText l _ x)    = fits m (w - l) x         fits _ _ (SLine _ _)      = True+        fits m w (SEffect _ x)    = fits m w x  -- @nicestR@ compares the initial lines of the two documents that are nested at -- least as deep as the current nesting level. If the initial lines of both@@ -1072,6 +1079,7 @@         fits m w (SText l _ x)           = fits m (w - l) x         fits m _ (SLine i x) | m < i     = 1 + fits m (p - i) x                              | otherwise = 0+        fits m w (SEffect _ x)           = fits m w x   -----------------------------------------------------------@@ -1097,6 +1105,7 @@                         Text l s    -> let k' = k+l in seq k' (SText l s (scan k' ds))                         Effect e    -> SEffect e (scan k ds)                         Line        -> SLine 0 (scan 0 ds)+                        FlatAlt y _ -> scan k (y:ds)                         Cat y z     -> scan k (y:z:ds)                         Nest _ y    -> scan k (y:ds)                         Union _ y   -> scan k (y:ds)
wl-pprint-extras.cabal view
@@ -1,6 +1,6 @@ name:          wl-pprint-extras category:      Control, Monads, Text-version:       3.5+version:       3.5.0.2 cabal-version: >= 1.8 license:       BSD3 license-file:  LICENSE@@ -29,7 +29,7 @@     semigroups    >= 0.9     && < 1,     semigroupoids >= 3       && < 5,     utf8-string   >= 0.3.6   && < 0.4,-    text          >= 0.11    && < 1.2+    text          >= 0.11    && < 1.3    exposed-modules:     Text.PrettyPrint.Free