Skip to content

Commit

Permalink
Workaround bug with dropWhileR in containers < 0.4.
Browse files Browse the repository at this point in the history
  • Loading branch information
John MacFarlane committed Feb 5, 2012
1 parent 0ec53ce commit e7eeadc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Text/Pandoc/Builder.hs
Expand Up @@ -226,8 +226,16 @@ instance Listable Blocks Block where


-- | Trim leading and trailing Sp (spaces) from an Inlines. -- | Trim leading and trailing Sp (spaces) from an Inlines.
trimInlines :: Inlines -> Inlines trimInlines :: Inlines -> Inlines
#if MIN_VERSION_containers(0,4,0)
trimInlines (Inlines ils) = Inlines $ Seq.dropWhileL (== Space) $ trimInlines (Inlines ils) = Inlines $ Seq.dropWhileL (== Space) $
Seq.dropWhileR (== Space) $ ils Seq.dropWhileR (== Space) $ ils
#else
-- for GHC 6.12, we need to workaround a bug in dropWhileR
-- see http://hackage.haskell.org/trac/ghc/ticket/4157
trimInlines (Inlines ils) = Inlines $ Seq.dropWhileL (== Space) $
Seq.reverse $ Seq.dropWhileL (== Space) $
Seq.reverse ils
#endif


-- Document builders -- Document builders


Expand Down

0 comments on commit e7eeadc

Please sign in to comment.