diff --git a/Rasterific.cabal b/Rasterific.cabal
--- a/Rasterific.cabal
+++ b/Rasterific.cabal
@@ -1,7 +1,7 @@
 -- Initial Rasterific.cabal generated by cabal init.  For further 
 -- documentation, see http://haskell.org/cabal/users-guide/
 name:                Rasterific
-version:             0.4
+version:             0.4.1
 synopsis:            A pure haskell drawing engine.
 -- A longer description of the package.
 description:
@@ -34,7 +34,7 @@
 Source-Repository this
     Type:      git
     Location:  git://github.com/Twinside/Rasterific.git
-    Tag:       v0.4
+    Tag:       v0.4.1
 
 flag embed_linear
   description: Embed a reduced version of Linear avoiding a (huge) dep
@@ -46,6 +46,7 @@
                  , Graphics.Rasterific.Outline
                  , Graphics.Rasterific.Texture
                  , Graphics.Rasterific.Linear
+                 , Graphics.Rasterific.Lenses
                  , Graphics.Rasterific.Transformations
                  , Graphics.Rasterific.Immediate
                  , Graphics.Rasterific.PathWalker
@@ -98,7 +99,7 @@
                  , binary
                  , QuickCheck
                  , deepseq
-                 , criterion
+                 , criterion >= 1.0
                  , statistics
                  --, groom
 
diff --git a/changelog b/changelog
--- a/changelog
+++ b/changelog
@@ -1,6 +1,9 @@
 -*-change-log-*-
 
-v0.4 2014
+v0.4.1 January 2015
+ * Fix: GHC 7.10 compilation
+
+v0.4 December 2014
  * Breaking change: Changed the original position scheme for
    text, allowing to specify baseline or upper left corner
 
diff --git a/docimages/cap_straight.png b/docimages/cap_straight.png
Binary files a/docimages/cap_straight.png and b/docimages/cap_straight.png differ
diff --git a/docimages/fill_evenodd.png b/docimages/fill_evenodd.png
Binary files a/docimages/fill_evenodd.png and b/docimages/fill_evenodd.png differ
diff --git a/docimages/fill_winding.png b/docimages/fill_winding.png
Binary files a/docimages/fill_winding.png and b/docimages/fill_winding.png differ
diff --git a/docimages/geometry_on_path.png b/docimages/geometry_on_path.png
Binary files a/docimages/geometry_on_path.png and b/docimages/geometry_on_path.png differ
diff --git a/docimages/linear_gradient.png b/docimages/linear_gradient.png
Binary files a/docimages/linear_gradient.png and b/docimages/linear_gradient.png differ
diff --git a/docimages/module_example.png b/docimages/module_example.png
Binary files a/docimages/module_example.png and b/docimages/module_example.png differ
diff --git a/docimages/radial_gradient_focus.png b/docimages/radial_gradient_focus.png
Binary files a/docimages/radial_gradient_focus.png and b/docimages/radial_gradient_focus.png differ
diff --git a/docimages/sampled_texture_reflect.png b/docimages/sampled_texture_reflect.png
Binary files a/docimages/sampled_texture_reflect.png and b/docimages/sampled_texture_reflect.png differ
diff --git a/docimages/sampled_texture_rotate.png b/docimages/sampled_texture_rotate.png
Binary files a/docimages/sampled_texture_rotate.png and b/docimages/sampled_texture_rotate.png differ
diff --git a/docimages/sampled_texture_scaled.png b/docimages/sampled_texture_scaled.png
Binary files a/docimages/sampled_texture_scaled.png and b/docimages/sampled_texture_scaled.png differ
diff --git a/docimages/sampler_pad.png b/docimages/sampler_pad.png
Binary files a/docimages/sampler_pad.png and b/docimages/sampler_pad.png differ
diff --git a/docimages/sampler_reflect.png b/docimages/sampler_reflect.png
Binary files a/docimages/sampler_reflect.png and b/docimages/sampler_reflect.png differ
diff --git a/docimages/sampler_repeat.png b/docimages/sampler_repeat.png
Binary files a/docimages/sampler_repeat.png and b/docimages/sampler_repeat.png differ
diff --git a/docimages/stroke_line.png b/docimages/stroke_line.png
Binary files a/docimages/stroke_line.png and b/docimages/stroke_line.png differ
diff --git a/docimages/stroke_polyline.png b/docimages/stroke_polyline.png
Binary files a/docimages/stroke_polyline.png and b/docimages/stroke_polyline.png differ
diff --git a/docimages/strokize_dashed_path.png b/docimages/strokize_dashed_path.png
Binary files a/docimages/strokize_dashed_path.png and b/docimages/strokize_dashed_path.png differ
diff --git a/docimages/text_on_path.png b/docimages/text_on_path.png
Binary files a/docimages/text_on_path.png and b/docimages/text_on_path.png differ
diff --git a/exec-src/rastertest.hs b/exec-src/rastertest.hs
--- a/exec-src/rastertest.hs
+++ b/exec-src/rastertest.hs
@@ -20,11 +20,10 @@
 import Codec.Picture
 import Arbitrary
 import System.Environment( getArgs )
-import Criterion.Config( defaultConfig )
-import Criterion.Main( parseArgs
-                     , defaultOptions
-                     , defaultMainWith
+import Criterion.Main.Options( defaultConfig )
+import Criterion.Main( defaultMainWith
                      , bench
+                     , nfIO
                      )
 {-import Text.Groom( groom )-}
 import qualified Sample as Sample
@@ -714,12 +713,10 @@
   -- -}
 
 benchTest :: [String] -> IO ()
-benchTest args = do
-  (config, _) <-
-      parseArgs defaultConfig defaultOptions args
-  defaultMainWith config (return ())
-        [bench "testsuite" testSuite,
-         bench "Triangles" Sample.triangles]
+benchTest _args = do
+  defaultMainWith defaultConfig
+        [bench "testsuite" $ nfIO testSuite,
+         bench "Triangles" $ nfIO Sample.triangles]
 
 main :: IO ()
 main = do
diff --git a/src/Graphics/Rasterific.hs b/src/Graphics/Rasterific.hs
--- a/src/Graphics/Rasterific.hs
+++ b/src/Graphics/Rasterific.hs
@@ -5,6 +5,7 @@
 {-# LANGUAGE TypeSynonymInstances #-}
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE ConstraintKinds #-}
+{-# LANGUAGE CPP #-}
 -- | Main module of Rasterific, an Haskell rasterization engine.
 --
 -- Creating an image is rather simple, here is a simple example
@@ -112,13 +113,18 @@
 
     ) where
 
+#if !MIN_VERSION_base(4,8,0)
+import Data.Monoid( Monoid( .. ) )
+#endif
+
+import Data.Monoid( (<>) )
+
 import Control.Applicative( (<$>) )
 import Control.Monad.Free( Free( .. ), liftF )
 import Control.Monad.Free.Church( fromF )
 import Control.Monad.ST( runST )
 import Control.Monad.State( modify, execState )
 import Data.Maybe( fromMaybe )
-import Data.Monoid( Monoid( .. ), (<>) )
 import Codec.Picture.Types( Image( .. ), Pixel( .. ) )
 
 import qualified Data.Vector.Unboxed as VU
diff --git a/src/Graphics/Rasterific/Command.hs b/src/Graphics/Rasterific/Command.hs
--- a/src/Graphics/Rasterific/Command.hs
+++ b/src/Graphics/Rasterific/Command.hs
@@ -3,15 +3,19 @@
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE FlexibleContexts #-}
 {-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE CPP #-}
 module Graphics.Rasterific.Command ( Drawing
                                    , DrawCommand( .. )
                                    , TextRange( .. )
                                    , dumpDrawing
                                    ) where
 
+#if !MIN_VERSION_base(4,8,0)
+import Data.Monoid( Monoid( .. ) )
+#endif
+
 import Control.Monad.Free( Free( .. ), liftF )
 import Control.Monad.Free.Church( F, fromF )
-import Data.Monoid( Monoid( .. ) )
 import Codec.Picture.Types( Pixel( .. ), Pixel8 )
 
 import Graphics.Rasterific.Types
diff --git a/src/Graphics/Rasterific/Compositor.hs b/src/Graphics/Rasterific/Compositor.hs
--- a/src/Graphics/Rasterific/Compositor.hs
+++ b/src/Graphics/Rasterific/Compositor.hs
@@ -1,5 +1,6 @@
 {-# LANGUAGE FlexibleContexts #-}
 {-# LANGUAGE ConstraintKinds #-}
+{-# LANGUAGE TypeFamilies #-}
 -- | Compositor handle the pixel composition, which
 -- leads to texture composition.
 -- Very much a work in progress
diff --git a/src/Graphics/Rasterific/CubicBezier.hs b/src/Graphics/Rasterific/CubicBezier.hs
--- a/src/Graphics/Rasterific/CubicBezier.hs
+++ b/src/Graphics/Rasterific/CubicBezier.hs
@@ -1,6 +1,7 @@
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE GADTs #-}
 {-# LANGUAGE BangPatterns #-}
+{-# LANGUAGE CPP #-}
 {-# OPTIONS_GHC -fno-warn-orphans #-}
 module Graphics.Rasterific.CubicBezier
     ( cubicBezierCircle
@@ -16,10 +17,14 @@
     ) where
 
 import Prelude hiding( or )
-import Control.Applicative( liftA2
-                          , (<$>)
-                          , pure
-                          )
+
+#if !MIN_VERSION_base(4,8,0)
+import Control.Applicative( pure )
+import Data.Monoid( mempty )
+#endif
+
+import Data.Monoid( (<>) )
+import Control.Applicative( liftA2, (<$>))
 import Graphics.Rasterific.Linear
              ( V2( .. )
              , (^-^)
@@ -29,7 +34,6 @@
              , lerp
              )
 import Data.List( nub )
-import Data.Monoid( mempty, (<>) )
 import Graphics.Rasterific.Operators
 import Graphics.Rasterific.Types
 import Graphics.Rasterific.QuadraticFormula
diff --git a/src/Graphics/Rasterific/Immediate.hs b/src/Graphics/Rasterific/Immediate.hs
--- a/src/Graphics/Rasterific/Immediate.hs
+++ b/src/Graphics/Rasterific/Immediate.hs
@@ -28,12 +28,10 @@
 
 import qualified Data.Foldable as F
 import Control.Monad.Free( liftF )
-import Control.Monad.ST( ST )
 import Control.Monad.State( StateT, execStateT, get, lift )
+import Control.Monad.State.Class(MonadState)
 import Codec.Picture.Types( Image( .. )
                           , Pixel( .. )
-                          , Pixel8
-                          , PixelRGBA8
                           , MutableImage( .. )
                           , unsafeFreezeImage
                           , fillImageWith )
@@ -49,8 +47,8 @@
 import Graphics.Rasterific.Command
 
 -- | Monad used to describe the drawing context.
-type DrawContext m px a =
-    StateT (MutableImage (PrimState m) px) m a
+type DrawContext m px =
+    StateT (MutableImage (PrimState m) px) m
 
 -- | Reify a filling function call, to be able to manipulate
 -- them in a simpler fashion.
@@ -127,17 +125,14 @@
 --
 -- <<docimages/immediate_fill.png>>
 --
-fillWithTexture :: (PrimMonad m, RenderablePixel px)
+fillWithTexture :: (PrimMonad m, RenderablePixel px,
+                    MonadState (MutableImage (PrimState m) px)
+                               (DrawContext m px)
+                   )
                 => FillMethod
                 -> Texture px  -- ^ Color/Texture used for the filling
                 -> [Primitive] -- ^ Primitives to fill
                 -> DrawContext m px ()
-{-# SPECIALIZE fillWithTexture
-    :: FillMethod -> Texture PixelRGBA8 -> [Primitive]
-    -> DrawContext (ST s) PixelRGBA8 () #-}
-{-# SPECIALIZE fillWithTexture
-    :: FillMethod -> Texture Pixel8 -> [Primitive]
-    -> DrawContext (ST s) Pixel8 () #-}
 fillWithTexture fillMethod texture els = do
     img@(MutableImage width height _) <- get
     let !mini = V2 0 0
@@ -168,7 +163,11 @@
 -- <<docimages/immediate_mask.png>>
 --
 fillWithTextureAndMask
-    :: (PrimMonad m, RenderablePixel px)
+    :: ( PrimMonad m
+       , RenderablePixel px
+       , MonadState (MutableImage (PrimState m) px)
+                    (DrawContext m px)
+       )
     => FillMethod
     -> Texture px  -- ^ Color/Texture used for the filling of the geometry
     -> Texture (PixelBaseComponent px) -- ^ Texture used for the mask.
diff --git a/src/Graphics/Rasterific/Lenses.hs b/src/Graphics/Rasterific/Lenses.hs
new file mode 100644
--- /dev/null
+++ b/src/Graphics/Rasterific/Lenses.hs
@@ -0,0 +1,147 @@
+{-# LANGUAGE RankNTypes #-}
+{-# LANGUAGE CPP #-}
+-- | This module provide lenses compatible with the `lens`
+-- module but without the dependency to it.
+module Graphics.Rasterific.Lenses
+    ( -- * Line lenses
+      lineX0
+    , lineX1
+    , linePoints
+
+      -- * Quadratic bezier curve
+    , bezX0
+    , bezX1
+    , bezX2
+    , bezierPoints
+
+      -- * Cubic bezier lenses
+    , cbezX0
+    , cbezX1
+    , cbezX2
+    , cbezX3
+    , cubicBezierPoints
+
+      -- * Primitive lenses
+    , primitivePoints
+
+      -- * Path oriented lenses
+    , pathCommandPoints
+    , pathPoints
+
+      -- * Type definition to match Lens
+    , Lens
+    , Lens'
+    , Traversal
+    , Traversal'
+    ) where
+
+#if !MIN_VERSION_base(4,8,0)
+import Data.Traversable( traverse )
+import Control.Applicative( Applicative, (<*>), pure )
+#endif
+
+import Control.Applicative( (<$>) )
+import Graphics.Rasterific.Types
+
+-- | Does it look familiar? yes it's the official
+-- Lens type.
+type Lens s t a b =
+    forall f. Functor f => (a -> f b) -> s -> f t
+
+-- | Try to match the Lens' type alias.
+type Lens' s a = Lens s s a a
+
+-- | Traversal type, matched to the one of the lens
+-- package.
+type Traversal s t a b =
+    forall f. Applicative f => (a -> f b) -> s -> f t
+
+type Traversal' s a = Traversal s s a a
+
+-- | Create a full lens out of setter and getter
+lens :: (s -> a)
+     -> (s -> b -> t)
+     -> Lens s t a b
+{-# INLINE lens #-}
+lens accessor setter = \f src ->
+  fmap (setter src) $ f (accessor src)
+
+-- | Traverse all the points of a line.
+linePoints :: Traversal' Line Point
+linePoints f (Line p0 p1) = Line <$> f p0 <*> f p1
+
+-- | Line origin point.
+lineX0 :: Lens' Line Point
+lineX0 = lens _lineX0 setter where
+  setter a b = a { _lineX0 = b }
+
+-- | Line end point.
+lineX1 :: Lens' Line Point
+lineX1 = lens _lineX1 setter where
+  setter a b = a { _lineX1 = b }
+
+-- | Quadratic bezier starting point.
+bezX0 :: Lens' Bezier Point
+bezX0 = lens _bezierX0 setter where
+  setter a b = a { _bezierX0 = b }
+
+-- | bezier control point.
+bezX1 :: Lens' Bezier Point
+bezX1 = lens _bezierX1 setter where
+  setter a b = a { _bezierX1 = b }
+
+-- | bezier end point.
+bezX2 :: Lens' Bezier Point
+bezX2 = lens _bezierX2 setter where
+  setter a b = a { _bezierX2 = b }
+
+-- | Traversal of all the bezier's points.
+bezierPoints :: Traversal' Bezier Point
+bezierPoints f (Bezier p0 p1 p2) =
+  Bezier <$> f p0 <*> f p1 <*> f p2
+
+-- | Cubic bezier first point
+cbezX0 :: Lens' CubicBezier Point
+cbezX0 = lens _cBezierX0 setter where
+  setter a b = a { _cBezierX0 = b }
+
+-- | Cubic bezier first control point.
+cbezX1 :: Lens' CubicBezier Point
+cbezX1 = lens _cBezierX1 setter where
+  setter a b = a { _cBezierX1 = b }
+
+-- | Cubic bezier second control point.
+cbezX2 :: Lens' CubicBezier Point
+cbezX2 = lens _cBezierX2 setter where
+  setter a b = a { _cBezierX2 = b }
+
+-- | Cubic bezier last point.
+cbezX3 :: Lens' CubicBezier Point
+cbezX3 = lens _cBezierX2 setter where
+  setter a b = a { _cBezierX3 = b }
+
+-- | Traversal of all the points of the cubic bezier.
+cubicBezierPoints :: Traversal' CubicBezier Point
+cubicBezierPoints f (CubicBezier p0 p1 p2 p3) =
+  CubicBezier <$> f p0 <*> f p1 <*> f p2 <*> f p3
+
+-- | Traverse all the points defined in the primitive.
+primitivePoints :: Traversal' Primitive Point
+primitivePoints f (LinePrim l) = LinePrim <$> linePoints f l
+primitivePoints f (BezierPrim b) = BezierPrim <$> bezierPoints f b
+primitivePoints f (CubicBezierPrim c) =
+    CubicBezierPrim <$> cubicBezierPoints f c
+
+-- | Traversal of all the points of a path
+pathCommandPoints :: Traversal' PathCommand Point
+pathCommandPoints f (PathLineTo p) = PathLineTo <$> f p
+pathCommandPoints f (PathQuadraticBezierCurveTo p1 p2) =
+    PathQuadraticBezierCurveTo <$> f p1 <*> f p2
+pathCommandPoints f (PathCubicBezierCurveTo p1 p2 p3) =
+    PathCubicBezierCurveTo <$> f p1 <*> f p2 <*> f p3
+
+-- | Traversal of all the points in a path.
+pathPoints :: Traversal' Path Point
+pathPoints f (Path p0 yn comms) =
+  Path <$> f p0 <*> pure yn <*> traverse (pathCommandPoints f) comms
+
diff --git a/src/Graphics/Rasterific/Line.hs b/src/Graphics/Rasterific/Line.hs
--- a/src/Graphics/Rasterific/Line.hs
+++ b/src/Graphics/Rasterific/Line.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE BangPatterns #-}
+{-# LANGUAGE CPP #-}
 -- | Handle straight lines polygon.
 module Graphics.Rasterific.Line
     ( lineFromPath
@@ -11,8 +12,14 @@
     , offsetLine
     ) where
 
-import Control.Applicative( (<$>), pure )
-import Data.Monoid( (<>), mempty )
+#if !MIN_VERSION_base(4,8,0)
+import Control.Applicative( pure )
+import Data.Monoid( mempty )
+#endif
+
+import Data.Monoid( (<>) )
+import Control.Applicative( (<$>) )
+
 import Graphics.Rasterific.Linear
              ( V2( .. )
              , (^-^)
diff --git a/src/Graphics/Rasterific/Linear.hs b/src/Graphics/Rasterific/Linear.hs
--- a/src/Graphics/Rasterific/Linear.hs
+++ b/src/Graphics/Rasterific/Linear.hs
@@ -21,7 +21,9 @@
 import Linear
 #else
 
+#if !MIN_VERSION_base(4,8,0)
 import Control.Applicative( Applicative, pure, (<*>) )
+#endif
 
 infixl 6 ^+^, ^-^
 infixl 7 ^*, ^/
diff --git a/src/Graphics/Rasterific/Operators.hs b/src/Graphics/Rasterific/Operators.hs
--- a/src/Graphics/Rasterific/Operators.hs
+++ b/src/Graphics/Rasterific/Operators.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
 -- | Module providing basic helper functions to help
 -- build vector/point calculations.
 module Graphics.Rasterific.Operators
@@ -26,8 +27,10 @@
     , isDistingableFrom
     ) where
 
-import Control.Applicative( Applicative
-                          , liftA2
+#if !MIN_VERSION_base(4,8,0)
+import Control.Applicative( Applicative )
+#endif
+import Control.Applicative( liftA2
                           , liftA3
                           , (<$>)
                           )
diff --git a/src/Graphics/Rasterific/PathWalker.hs b/src/Graphics/Rasterific/PathWalker.hs
--- a/src/Graphics/Rasterific/PathWalker.hs
+++ b/src/Graphics/Rasterific/PathWalker.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE CPP #-}
 -- | This module help the walking of path of any shape,
 -- being able to return the current position and the
 -- actual orientation.
@@ -13,8 +14,15 @@
                                      , drawOrdersOnPath
                                      ) where
 
+#if !MIN_VERSION_base(4,8,0)
 import Data.Foldable( foldMap )
-import Control.Applicative( Applicative, (<$>), (<*>) )
+import Data.Monoid( mempty )
+import Control.Applicative( Applicative, (<*>) )
+#endif
+
+import Data.Monoid( (<>) )
+import Control.Applicative( (<$>) )
+
 import Control.Monad.Identity( Identity )
 import Control.Monad.State( StateT
                           , MonadTrans
@@ -22,7 +30,6 @@
                           , evalStateT
                           , modify
                           , gets )
-import Data.Monoid( mempty, (<>) )
 import Data.Maybe( fromMaybe )
 
 import Graphics.Rasterific.Types
diff --git a/src/Graphics/Rasterific/PlaneBoundable.hs b/src/Graphics/Rasterific/PlaneBoundable.hs
--- a/src/Graphics/Rasterific/PlaneBoundable.hs
+++ b/src/Graphics/Rasterific/PlaneBoundable.hs
@@ -1,5 +1,6 @@
 {-# LANGUAGE TypeSynonymInstances #-}
 {-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE CPP #-}
 -- | Module implementing types used for geometry
 -- bound calculations.
 module Graphics.Rasterific.PlaneBoundable ( PlaneBound( .. )
@@ -9,9 +10,15 @@
                                           , boundLowerLeftCorner
                                           ) where
 
-import Control.Applicative( (<$>), (<*>) )
-import Data.Monoid( Monoid( .. ), (<>) )
+#if !MIN_VERSION_base(4,8,0)
+-- to be removed with GHC 7.12 ?
+import Control.Applicative( (<*>) )
+import Data.Monoid( Monoid( .. ) )
 import Data.Foldable( foldMap )
+#endif
+
+import Control.Applicative( (<$>) )
+import Data.Monoid( (<>) )
 
 import Graphics.Rasterific.Linear( V2( .. ) )
 import Graphics.Rasterific.Types
diff --git a/src/Graphics/Rasterific/QuadraticBezier.hs b/src/Graphics/Rasterific/QuadraticBezier.hs
--- a/src/Graphics/Rasterific/QuadraticBezier.hs
+++ b/src/Graphics/Rasterific/QuadraticBezier.hs
@@ -1,6 +1,7 @@
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE BangPatterns #-}
+{-# LANGUAGE CPP #-}
 -- | Module handling math regarding the handling of quadratic
 -- and cubic bezier curve.
 module Graphics.Rasterific.QuadraticBezier
@@ -16,7 +17,10 @@
     , bezierLengthApproximation
     ) where
 
+#if !MIN_VERSION_base(4,8,0)
 import Control.Applicative( pure )
+import Data.Monoid( Monoid( mempty ) )
+#endif
 import Graphics.Rasterific.Linear
              ( V2( .. )
              , (^-^)
@@ -26,7 +30,8 @@
              , norm
              , lerp
              )
-import Data.Monoid( Monoid( mempty ), (<>) )
+
+import Data.Monoid( (<>) )
 import Graphics.Rasterific.Operators
 import Graphics.Rasterific.Types
 
diff --git a/src/Graphics/Rasterific/QuadraticFormula.hs b/src/Graphics/Rasterific/QuadraticFormula.hs
--- a/src/Graphics/Rasterific/QuadraticFormula.hs
+++ b/src/Graphics/Rasterific/QuadraticFormula.hs
@@ -1,9 +1,12 @@
+{-# LANGUAGE CPP #-}
 module Graphics.Rasterific.QuadraticFormula( QuadraticFormula( .. )
                                            , discriminant
                                            , formulaRoots
                                            ) where
 
+#if !MIN_VERSION_base(4,8,0)
 import Control.Applicative( Applicative( .. ) )
+#endif
 
 -- | Represent an equation `a * x^2 + b * x + c = 0`
 data QuadraticFormula a = QuadraticFormula
diff --git a/src/Graphics/Rasterific/Rasterize.hs b/src/Graphics/Rasterific/Rasterize.hs
--- a/src/Graphics/Rasterific/Rasterize.hs
+++ b/src/Graphics/Rasterific/Rasterize.hs
@@ -1,13 +1,17 @@
 {-# LANGUAGE BangPatterns #-}
+{-# LANGUAGE CPP #-}
 module Graphics.Rasterific.Rasterize
     ( CoverageSpan( .. )
     , rasterize
     , clip
     ) where
 
+#if !MIN_VERSION_base(4,8,0)
+import Data.Foldable( foldMap )
+#endif
+
 import Control.Monad.ST( runST )
 import Data.Fixed( mod' )
-import Data.Foldable( foldMap )
 import Data.Monoid( Endo( Endo, appEndo ) )
 import Graphics.Rasterific.Types
 import Graphics.Rasterific.QuadraticBezier
diff --git a/src/Graphics/Rasterific/Shading.hs b/src/Graphics/Rasterific/Shading.hs
--- a/src/Graphics/Rasterific/Shading.hs
+++ b/src/Graphics/Rasterific/Shading.hs
@@ -285,9 +285,9 @@
 gradientColorAt :: ModulablePixel px
                 => GradientArray px -> Float -> px
 {-# SPECIALIZE
- 	gradientColorAt :: GradientArray PixelRGBA8 -> Float -> PixelRGBA8 #-}
+     gradientColorAt :: GradientArray PixelRGBA8 -> Float -> PixelRGBA8 #-}
 {-# SPECIALIZE
- 	gradientColorAt :: GradientArray Pixel8 -> Float -> Pixel8 #-}
+     gradientColorAt :: GradientArray Pixel8 -> Float -> Pixel8 #-}
 gradientColorAt grad at
     | at <= 0 = snd $ V.head grad
     | at >= 1.0 = snd $ V.last grad
@@ -305,11 +305,11 @@
 gradientColorAtRepeat :: ModulablePixel px
                       => SamplerRepeat -> GradientArray px -> Float -> px
 {-# SPECIALIZE INLINE
-	gradientColorAtRepeat ::
-		SamplerRepeat -> GradientArray PixelRGBA8 -> Float -> PixelRGBA8 #-}
+    gradientColorAtRepeat ::
+        SamplerRepeat -> GradientArray PixelRGBA8 -> Float -> PixelRGBA8 #-}
 {-# SPECIALIZE INLINE
-	gradientColorAtRepeat ::
-		SamplerRepeat -> GradientArray Pixel8 -> Float -> Pixel8 #-}
+    gradientColorAtRepeat ::
+        SamplerRepeat -> GradientArray Pixel8 -> Float -> Pixel8 #-}
 gradientColorAtRepeat SamplerPad grad = gradientColorAt grad
 gradientColorAtRepeat SamplerRepeat grad =
     gradientColorAt grad . repeatGradient
@@ -344,11 +344,11 @@
 sampledImageShader :: forall px.  ModulablePixel px
                    => Image px -> SamplerRepeat -> ShaderFunction px
 {-# SPECIALIZE
- 	sampledImageShader :: Image Pixel8 -> SamplerRepeat
- 	                   -> ShaderFunction Pixel8 #-}
+     sampledImageShader :: Image Pixel8 -> SamplerRepeat
+                        -> ShaderFunction Pixel8 #-}
 {-# SPECIALIZE
- 	sampledImageShader :: Image PixelRGBA8 -> SamplerRepeat
- 	                   -> ShaderFunction PixelRGBA8 #-}
+     sampledImageShader :: Image PixelRGBA8 -> SamplerRepeat
+                        -> ShaderFunction PixelRGBA8 #-}
 sampledImageShader img sampling x y =
   (at px  py `interpX` at pxn py)
              `interpY`
@@ -394,9 +394,9 @@
 -- filtering at all.
 imageShader :: forall px. (Pixel px) => Image px -> ShaderFunction px
 {-# SPECIALIZE
-	imageShader :: Image PixelRGBA8 -> ShaderFunction PixelRGBA8 #-}
+    imageShader :: Image PixelRGBA8 -> ShaderFunction PixelRGBA8 #-}
 {-# SPECIALIZE
-	imageShader :: Image Pixel8 -> ShaderFunction Pixel8 #-}
+    imageShader :: Image Pixel8 -> ShaderFunction Pixel8 #-}
 imageShader img x y =
     unsafePixelAt rawData $ (clampedY * w + clampedX) * compCount
   where
diff --git a/src/Graphics/Rasterific/StrokeInternal.hs b/src/Graphics/Rasterific/StrokeInternal.hs
--- a/src/Graphics/Rasterific/StrokeInternal.hs
+++ b/src/Graphics/Rasterific/StrokeInternal.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
 module Graphics.Rasterific.StrokeInternal
     ( flatten
     , dashize
@@ -7,9 +8,15 @@
     , approximatePathLength
     )  where
 
-import Control.Applicative( (<$>), pure )
-import Data.Monoid( (<>), mempty )
+#if !MIN_VERSION_base(4,8,0)
+import Control.Applicative( pure )
+import Data.Monoid( mempty )
 import Data.Foldable( foldMap )
+#endif
+
+import Control.Applicative( (<$>) )
+import Data.Monoid( (<>) )
+
 import Graphics.Rasterific.Linear
              ( V2( .. )
              , (^-^)
@@ -61,7 +68,7 @@
                 --     Xp
                 -- ^  / \  ^
                 -- u\/   \/v
-                --  /     \
+                --  /     \   .
                 a = p ^+^ u ^* offset
                 c = p ^+^ v ^* offset
 
@@ -130,7 +137,7 @@
         --     Xp
         -- ^  / \  ^
         -- u\/   \/v
-        --  /     \
+        --  /     \     .
         a = point ^+^ u ^* offset
         c = point ^+^ v ^* offset
         w = (a `normal` c) `ifZero` u
diff --git a/src/Graphics/Rasterific/Transformations.hs b/src/Graphics/Rasterific/Transformations.hs
--- a/src/Graphics/Rasterific/Transformations.hs
+++ b/src/Graphics/Rasterific/Transformations.hs
@@ -4,6 +4,7 @@
 --
 -- You can combine the transformation is `mappend` or
 -- the `(\<\>)` operator from "Data.Monoid" .
+{-# LANGUAGE CPP #-}
 module Graphics.Rasterific.Transformations
     ( Transformation( .. )
     , applyTransformation
@@ -18,7 +19,10 @@
     , inverseTransformation
     ) where
 
-import Data.Monoid( Monoid( .. ), (<>) )
+#if !MIN_VERSION_base(4,8,0)
+import Data.Monoid( Monoid( .. )  )
+#endif
+import Data.Monoid( (<>) )
 import Graphics.Rasterific.Types
 import Graphics.Rasterific.Linear( V2( .. ), (^+^), normalize )
 
diff --git a/src/Graphics/Rasterific/Types.hs b/src/Graphics/Rasterific/Types.hs
--- a/src/Graphics/Rasterific/Types.hs
+++ b/src/Graphics/Rasterific/Types.hs
@@ -2,6 +2,7 @@
 {-# LANGUAGE FlexibleContexts #-}
 {-# LANGUAGE GADTs #-}
 {-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE CPP #-}
 -- | Gather all the types used in the rasterization engine.
 module Graphics.Rasterific.Types
     ( -- * Geometry description
@@ -35,7 +36,11 @@
     ) where
 
 import Data.DList( DList, fromList, toList  )
-import Data.Foldable( Foldable, foldl' )
+
+#if !MIN_VERSION_base(4,8,0)
+import Data.Foldable( Foldable )
+#endif
+import Data.Foldable( foldl' )
 import Graphics.Rasterific.Linear( V2( .. ) )
 
 import Foreign.Ptr( castPtr )
