git.iko.soy/typeable/pandoc
on master help sign in
Remove dependency on dlist.

Use sequence in Pretty instead.

commit4dec972cfe6827f4c7a40cf1c50e4a0120d4e442 authorJohn MacFarlane <fiddlosopher@gmail.com> dateSun 5 Feb 2012, 14:25 (15 years ago) parenteed87d7
2 files changed+7−8
pandoc.cabal−2 src/Text/Pandoc/Pretty.hs+7−6
pandoc.cabal−2
@@ -212,7 +212,6 @@ Library
212212 citeproc-hs >= 0.3.4 && < 0.4,
213213 pandoc-types == 1.9.*,
214214 json >= 0.4 && < 0.6,
215− dlist >= 0.4 && < 0.6,
216215 tagsoup >= 0.12.5 && < 0.13,
217216 base64-bytestring >= 0.1 && < 0.2,
218217 zlib >= 0.5 && <= 0.6,
@@ -307,7 +306,6 @@ Executable pandoc
307306 citeproc-hs >= 0.3.4 && < 0.4,
308307 pandoc-types == 1.9.*,
309308 json >= 0.4 && < 0.6,
310− dlist >= 0.4 && < 0.6,
311309 tagsoup >= 0.12.5 && < 0.13,
312310 base64-bytestring >= 0.1 && < 0.2,
313311 zlib >= 0.5 && <= 0.6,
src/Text/Pandoc/Pretty.hs+7−6
@@ -72,7 +72,8 @@ module Text.Pandoc.Pretty (
7272 )
7373
7474where
75−import Data.DList (DList, fromList, toList, cons, singleton)
75+import Data.Sequence (Seq, fromList, (<|), singleton)
76+import Data.Foldable (toList)
7677import Data.List (intercalate)
7778import Data.Monoid
7879import Data.String
@@ -102,7 +103,7 @@ data D = Text Int String
102103 | BlankLine
103104 deriving (Show)
104105
105−newtype Doc = Doc { unDoc :: DList D }
106+newtype Doc = Doc { unDoc :: Seq D }
106107 deriving (Monoid)
107108
108109instance Show Doc where
@@ -342,12 +343,12 @@ offsetOf _ = 0
342343-- | A literal string.
343344text :: String -> Doc
344345text = Doc . toChunks
345− where toChunks :: String -> DList D
346+ where toChunks :: String -> Seq D
346347 toChunks [] = mempty
347348 toChunks s = case break (=='\n') s of
348− ([], _:ys) -> NewLine `cons` toChunks ys
349− (xs, _:ys) -> Text (realLength xs) xs `cons`
350− NewLine `cons` toChunks ys
349+ ([], _:ys) -> NewLine <| toChunks ys
350+ (xs, _:ys) -> Text (realLength xs) xs <|
351+ (NewLine <| toChunks ys)
351352 (xs, []) -> singleton $ Text (realLength xs) xs
352353
353354-- | A character.