diff --git a/Text/Pandoc/Builder.hs b/Text/Pandoc/Builder.hs
--- a/Text/Pandoc/Builder.hs
+++ b/Text/Pandoc/Builder.hs
@@ -1,5 +1,5 @@
 {-# LANGUAGE TypeSynonymInstances, FlexibleInstances, MultiParamTypeClasses,
-    DeriveDataTypeable, GeneralizedNewtypeDeriving #-}
+    DeriveDataTypeable, GeneralizedNewtypeDeriving, CPP #-}
 {-
 Copyright (C) 2010 John MacFarlane <jgm@berkeley.edu>
 
@@ -148,8 +148,16 @@
 import Data.Typeable
 import Control.Arrow ((***))
 
-(<>) :: Monoid a => a -> a -> a
+#if MIN_VERSION_base(4,5,0)
+-- (<>) is defined in Data.Monoid
+#else
+infixr 6 <>
+
+-- | An infix synonym for 'mappend'.
+(<>) :: Monoid m => m -> m -> m
 (<>) = mappend
+{-# INLINE (<>) #-}
+#endif
 
 newtype Inlines = Inlines { unInlines :: Seq Inline }
                 deriving (Data, Ord, Eq, Typeable)
@@ -218,8 +226,16 @@
 
 -- | Trim leading and trailing Sp (spaces) from an Inlines.
 trimInlines :: Inlines -> Inlines
+#if MIN_VERSION_containers(0,4,0)
 trimInlines (Inlines ils) = Inlines $ Seq.dropWhileL (== Space) $
                             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
 
diff --git a/pandoc-types.cabal b/pandoc-types.cabal
--- a/pandoc-types.cabal
+++ b/pandoc-types.cabal
@@ -1,5 +1,5 @@
 Name:                pandoc-types
-Version:             1.9.0.1
+Version:             1.9.0.2
 Synopsis:            Types for representing a structured document
 Description:         This package contains definitions for the 'Pandoc' data
                      structure, which is used by pandoc to represent
