diff --git a/HaTeX.cabal b/HaTeX.cabal
--- a/HaTeX.cabal
+++ b/HaTeX.cabal
@@ -1,5 +1,5 @@
 Name: HaTeX
-Version: 3.16.1.0
+Version: 3.16.1.1
 Author: Daniel Díaz
 Category: LaTeX
 Build-type: Simple
diff --git a/Text/LaTeX/Base/Class.hs b/Text/LaTeX/Base/Class.hs
--- a/Text/LaTeX/Base/Class.hs
+++ b/Text/LaTeX/Base/Class.hs
@@ -1,4 +1,5 @@
 
+{-# LANGUAGE CPP #-}
 {-# OPTIONS_GHC -fno-warn-name-shadowing #-}
 
 -- | Definition of the 'LaTeXC' class, used to combine the classic applicative and
@@ -27,8 +28,10 @@
  ) where
 
 import Text.LaTeX.Base.Syntax
-import Data.Monoid
 import Data.String
+#if !MIN_VERSION_base(4,8,0)
+import Data.Monoid
+#endif
 
 -- | This is the class of 'LaTeX' code generators. It has 'Monoid' and 'IsString' as
 --   superclasses.
diff --git a/Text/LaTeX/Base/Commands.hs b/Text/LaTeX/Base/Commands.hs
--- a/Text/LaTeX/Base/Commands.hs
+++ b/Text/LaTeX/Base/Commands.hs
@@ -952,7 +952,7 @@
                                                             , FixArg t ]
 makebox (Just w) (Just p) = liftL $ \t -> TeXComm "makebox" [ OptArg $ TeXRaw $ render w
                                                             , OptArg $ TeXRaw $ render p
-                                                            , FixArg t ]	
+                                                            , FixArg t ]
 
 framebox :: LaTeXC l =>  Maybe Measure -> Maybe HPos -> l -> l
 framebox Nothing Nothing   = liftL $ \t -> TeXComm "framebox" [ FixArg t ]
diff --git a/Text/LaTeX/Base/Pretty.hs b/Text/LaTeX/Base/Pretty.hs
--- a/Text/LaTeX/Base/Pretty.hs
+++ b/Text/LaTeX/Base/Pretty.hs
@@ -1,4 +1,6 @@
 
+{-# LANGUAGE CPP #-}
+
 -- | 'LaTeX' values pretty printer.
 --
 --   Still experimental. Give it a try and send us your feedback! :)
@@ -20,7 +22,9 @@
   , renderSmart, displayS
     )
 import Data.Text (unpack,lines)
+#if !MIN_VERSION_base(4,8,0)
 import Data.Monoid (mconcat,mempty)
+#endif
 
 -- | This function transforms a value of type 'LaTeX' to a 'Doc'.
 --   You can then choose how to print this 'Doc' value using
diff --git a/Text/LaTeX/Base/Warnings.hs b/Text/LaTeX/Base/Warnings.hs
--- a/Text/LaTeX/Base/Warnings.hs
+++ b/Text/LaTeX/Base/Warnings.hs
@@ -1,5 +1,5 @@
 
-{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE OverloadedStrings, CPP #-}
 
 -- | This module provides functionality for check a 'LaTeX' value for
 --   possibly undesired things (like the call to an undefined label),
@@ -24,7 +24,9 @@
 import Data.Text
 import Data.Maybe
 import Control.Arrow
+#if !MIN_VERSION_base(4,8,0)
 import Data.Monoid
+#endif
 
 -- | List of possible warnings.
 data Warning =
diff --git a/Text/LaTeX/Base/Writer.hs b/Text/LaTeX/Base/Writer.hs
--- a/Text/LaTeX/Base/Writer.hs
+++ b/Text/LaTeX/Base/Writer.hs
@@ -1,5 +1,5 @@
 
-{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE TypeFamilies, CPP #-}
 
 -- | The writer monad applied to 'LaTeX' values. Useful to compose 'LaTeX' values
 --   using the @do@ notation:
@@ -54,11 +54,13 @@
    ) where
 
 -- base
-import Control.Applicative
 import Control.Monad (liftM)
 import Control.Arrow
 import Data.String
+#if !MIN_VERSION_base(4,8,0)
 import Data.Monoid
+import Control.Applicative
+#endif
 -- transformers
 import Control.Monad.Trans.Writer
 import Control.Monad.IO.Class
diff --git a/Text/LaTeX/Packages/TikZ/PathBuilder.hs b/Text/LaTeX/Packages/TikZ/PathBuilder.hs
--- a/Text/LaTeX/Packages/TikZ/PathBuilder.hs
+++ b/Text/LaTeX/Packages/TikZ/PathBuilder.hs
@@ -1,4 +1,6 @@
 
+{-# LANGUAGE CPP #-}
+
 -- | This module provides a monadic interface to build 'TPath' values.
 --   It does so using 'PathBuilder's. The construction of a 'PathBuilder'
 --   is equivalent to the construction of a 'TPath' by hand, but with
@@ -38,7 +40,9 @@
 import Text.LaTeX.Base.Syntax (LaTeX)
 import Text.LaTeX.Packages.TikZ.Syntax
 import Control.Monad.Trans.State
+#if !MIN_VERSION_base(4,8,0)
 import Control.Applicative
+#endif
 
 data PathState = PS { currentPath :: TPath }
 
diff --git a/Text/LaTeX/Packages/TikZ/Syntax.hs b/Text/LaTeX/Packages/TikZ/Syntax.hs
--- a/Text/LaTeX/Packages/TikZ/Syntax.hs
+++ b/Text/LaTeX/Packages/TikZ/Syntax.hs
@@ -1,5 +1,5 @@
 
-{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE OverloadedStrings, CPP #-}
 
 -- | This module defines the syntax of a Ti/k/Z script.
 --
@@ -46,9 +46,11 @@
 import Text.LaTeX.Base.Render
 import Text.LaTeX.Base.Syntax
 import Text.LaTeX.Packages.Color
+import qualified Data.Sequence as S
+#if !MIN_VERSION_base(4,8,0)
 import Data.Monoid
 import Data.Foldable (foldMap)
-import qualified Data.Sequence as S
+#endif
 
 -- POINTS
 
diff --git a/Text/LaTeX/Packages/Trees.hs b/Text/LaTeX/Packages/Trees.hs
--- a/Text/LaTeX/Packages/Trees.hs
+++ b/Text/LaTeX/Packages/Trees.hs
@@ -1,13 +1,17 @@
 
+{-# LANGUAGE CPP #-}
+
 -- | Tree definition with some class instances.
 module Text.LaTeX.Packages.Trees (
    -- * Tree
    Tree (..)
  ) where
 
+#if !MIN_VERSION_base(4,8,0)
 import Data.Monoid
 import Data.Foldable
 import Data.Traversable
+#endif
 import Control.Applicative
 
 -- | Tree datatype.
