@@ -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.