diff --git a/AUTHORS.md b/AUTHORS.md
--- a/AUTHORS.md
+++ b/AUTHORS.md
@@ -28,6 +28,7 @@
 * Artyom (@neongreen)
 * Auke Booij
 * Ben Pence
+* Benjamin Kästner
 * Björn Buckwalter
 * Bryan O'Sullivan
 * Cies Breijs
diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,17 @@
+## Megaparsec 4.1.0
+
+* Relaxed dependency on `base`, so that minimal required version of `base`
+  is now 4.6.0.0. This allows Megaparsec to compile with GHC 7.6.x.
+
+* `Text.Megaparsec` and `Text.Megaparsec.Prim` do not export data types
+  `Consumed` and `Reply` anymore because they are rather low-level
+  implementation details that should not be visible to end-user.
+
+* Representation of file name and textual position in error messages was
+  made conventional.
+
+* Fixed some typos is documentation and other materials.
+
 ## Megaparsec 4.0.0
 
 ### General changes
@@ -41,7 +55,7 @@
 ### Error messages
 
 * Introduced type class `ShowToken` and improved representation of
-  characters and stings in error messages, see #12.
+  characters and strings in error messages, see #12.
 
 * Greatly improved quality of error messages. Fixed entire
   `Text.Megaparsec.Error` module, see #14 for more information. Made
diff --git a/Text/Megaparsec.hs b/Text/Megaparsec.hs
--- a/Text/Megaparsec.hs
+++ b/Text/Megaparsec.hs
@@ -136,8 +136,6 @@
   , sourceColumn
     -- * Low-level operations
   , Stream (..)
-  , Consumed (..)
-  , Reply (..)
   , State (..)
   , getInput
   , setInput
diff --git a/Text/Megaparsec/ByteString.hs b/Text/Megaparsec/ByteString.hs
--- a/Text/Megaparsec/ByteString.hs
+++ b/Text/Megaparsec/ByteString.hs
@@ -38,4 +38,4 @@
 -- >     Right xs -> print (sum xs)
 
 parseFromFile :: Parser a -> String -> IO (Either ParseError a)
-parseFromFile p fname = runParser p fname <$> C.readFile fname
+parseFromFile p fname = runParser p fname `fmap` C.readFile fname
diff --git a/Text/Megaparsec/ByteString/Lazy.hs b/Text/Megaparsec/ByteString/Lazy.hs
--- a/Text/Megaparsec/ByteString/Lazy.hs
+++ b/Text/Megaparsec/ByteString/Lazy.hs
@@ -38,4 +38,4 @@
 -- >     Right xs -> print (sum xs)
 
 parseFromFile :: Parser a -> String -> IO (Either ParseError a)
-parseFromFile p fname = runParser p fname <$> C.readFile fname
+parseFromFile p fname = runParser p fname `fmap` C.readFile fname
diff --git a/Text/Megaparsec/Char.hs b/Text/Megaparsec/Char.hs
--- a/Text/Megaparsec/Char.hs
+++ b/Text/Megaparsec/Char.hs
@@ -7,7 +7,7 @@
 --
 -- Maintainer  :  Mark Karpov <markkarpov@opmbx.org>
 -- Stability   :  experimental
--- Portability :  portable
+-- Portability :  non-portable
 --
 -- Commonly used character parsers.
 
@@ -63,6 +63,10 @@
 import Text.Megaparsec.Prim
 import Text.Megaparsec.ShowToken
 
+#if !MIN_VERSION_base(4,8,0)
+import Control.Applicative ((<$>), pure)
+#endif
+
 -- | Parses a newline character.
 
 newline :: MonadParsec s m Char => m Char
@@ -252,7 +256,7 @@
 -- >>> parseTest (char' 'e') "E"
 -- 'E'
 -- >>> parseTest (char' 'e') "G"
--- parse error at line 1, column 1:
+-- 1:1:
 -- unexpected 'G'
 -- expecting 'E' or 'e'
 
diff --git a/Text/Megaparsec/Combinator.hs b/Text/Megaparsec/Combinator.hs
--- a/Text/Megaparsec/Combinator.hs
+++ b/Text/Megaparsec/Combinator.hs
@@ -39,6 +39,10 @@
 import Control.Monad (void)
 import Data.Foldable (asum)
 
+#if !MIN_VERSION_base(4,8,0)
+import Data.Foldable (Foldable)
+#endif
+
 -- | @between open close p@ parses @open@, followed by @p@ and @close@.
 -- Returns the value returned by @p@.
 --
diff --git a/Text/Megaparsec/Error.hs b/Text/Megaparsec/Error.hs
--- a/Text/Megaparsec/Error.hs
+++ b/Text/Megaparsec/Error.hs
@@ -28,11 +28,23 @@
   , showMessages )
 where
 
+#if MIN_VERSION_base(4,7,0)
 import Data.Bool (bool)
+#endif
 import Data.List (intercalate)
 import Data.Maybe (fromMaybe)
 
 import Text.Megaparsec.Pos
+
+#if !MIN_VERSION_base(4,8,0)
+import Control.Applicative ((<$>))
+import Data.Foldable (foldMap)
+#endif
+#if !MIN_VERSION_base(4,7,0)
+bool :: a -> a -> Bool -> a
+bool f _ False = f
+bool _ t True  = t
+#endif
 
 -- | This data type represents parse error messages. There are three kinds
 -- of messages:
diff --git a/Text/Megaparsec/Lexer.hs b/Text/Megaparsec/Lexer.hs
--- a/Text/Megaparsec/Lexer.hs
+++ b/Text/Megaparsec/Lexer.hs
@@ -7,12 +7,12 @@
 --
 -- Maintainer  :  Mark Karpov <markkarpov@opmbx.org>
 -- Stability   :  experimental
--- Portability :  non-portable (uses local universal quantification: PolymorphicComponents)
+-- Portability :  non-portable
 --
 -- High-level parsers to help you write your lexer. The module doesn't
 -- impose how you should write your parser, but certain approaches may be
--- more elegant than others. Especially important theme is parsing of write
--- space, comments and indentation.
+-- more elegant than others. Especially important theme is parsing of white
+-- space, comments, and indentation.
 --
 -- This module is intended to be imported qualified:
 --
@@ -50,6 +50,10 @@
 import Text.Megaparsec.ShowToken
 import qualified Text.Megaparsec.Char as C
 
+#if !MIN_VERSION_base(4,8,0)
+import Control.Applicative ((<$>), (<*), (*>), (<*>), pure)
+#endif
+
 -- White space and indentation
 
 -- | @space spaceChar lineComment blockComment@ produces parser that can
@@ -197,7 +201,7 @@
 -- | Parse an integer in hexadecimal representation. Representation of
 -- hexadecimal number is expected to be according to Haskell report except
 -- for the fact that this parser doesn't parse “0x” or “0X” prefix. It is
--- reponsibility of the programmer to parse correct prefix before parsing
+-- responsibility of the programmer to parse correct prefix before parsing
 -- the number itself.
 --
 -- For example you can make it conform to Haskell report like this:
diff --git a/Text/Megaparsec/Perm.hs b/Text/Megaparsec/Perm.hs
--- a/Text/Megaparsec/Perm.hs
+++ b/Text/Megaparsec/Perm.hs
@@ -7,13 +7,15 @@
 --
 -- Maintainer  :  Mark Karpov <markkarpov@opmbx.org>
 -- Stability   :  experimental
--- Portability :  non-portable (uses existentially quantified data constructors)
+-- Portability :  non-portable
 --
 -- This module implements permutation parsers. The algorithm is described
 -- in: /Parsing Permutation Phrases/, by Arthur Baars, Andres Loh and
 -- Doaitse Swierstra. Published as a functional pearl at the Haskell
 -- Workshop 2001.
 
+{-# LANGUAGE ExistentialQuantification #-}
+
 module Text.Megaparsec.Perm
   ( PermParser
   , makePermParser
@@ -25,6 +27,10 @@
 
 import Text.Megaparsec.Combinator (choice)
 import Text.Megaparsec.Prim
+
+#if !MIN_VERSION_base(4,8,0)
+import Control.Applicative ((<$>), (<*>))
+#endif
 
 infixl 1 <||>, <|?>
 infixl 2 <$$>, <$?>
diff --git a/Text/Megaparsec/Pos.hs b/Text/Megaparsec/Pos.hs
--- a/Text/Megaparsec/Pos.hs
+++ b/Text/Megaparsec/Pos.hs
@@ -49,8 +49,8 @@
 instance Show SourcePos where
   show (SourcePos n l c)
     | null n    = showLC
-    | otherwise = "\"" ++ n ++ "\" " ++ showLC
-    where showLC = "line " ++ show l ++ ", column " ++ show c
+    | otherwise = n ++ ":" ++ showLC
+      where showLC = show l ++ ":" ++ show c
 
 -- | Create a new 'SourcePos' with the given source name, line number and
 -- column number.
diff --git a/Text/Megaparsec/Prim.hs b/Text/Megaparsec/Prim.hs
--- a/Text/Megaparsec/Prim.hs
+++ b/Text/Megaparsec/Prim.hs
@@ -7,7 +7,7 @@
 --
 -- Maintainer  :  Mark Karpov <markkarpov@opmbx.org>
 -- Stability   :  experimental
--- Portability :  portable
+-- Portability :  non-portable (MPTC with FD)
 --
 -- The primitive parser combinators.
 
@@ -17,8 +17,6 @@
   ( -- * Used data-types
     State (..)
   , Stream (..)
-  , Consumed (..)
-  , Reply (..)
   , Parsec
   , ParsecT
     -- * Primitive combinators
@@ -40,7 +38,9 @@
   , parseTest )
 where
 
+#if MIN_VERSION_base(4,7,0)
 import Data.Bool (bool)
+#endif
 import Data.Monoid
 
 import Control.Monad
@@ -67,6 +67,15 @@
 import Text.Megaparsec.Pos
 import Text.Megaparsec.ShowToken
 
+#if !MIN_VERSION_base(4,8,0)
+import Control.Applicative ((<$>), (<*))
+#endif
+#if !MIN_VERSION_base(4,7,0)
+bool :: a -> a -> Bool -> a
+bool f _ False = f
+bool _ t True  = t
+#endif
+
 -- | This is Megaparsec state, it's parametrized over stream type @s@.
 
 data State s = State
@@ -130,14 +139,14 @@
 -- For example, without hints you could get:
 --
 -- >>> parseTest (many (char 'r') <* eof) "ra"
--- parse error at line 1, column 2:
+-- 1:2:
 -- unexpected 'a'
 -- expecting end of input
 --
 -- We're getting better error messages with help of hints:
 --
 -- >>> parseTest (many (char 'r') <* eof) "ra"
--- parse error at line 1, column 2:
+-- 1:2:
 -- unexpected 'a'
 -- expecting 'r' or end of input
 
@@ -375,7 +384,7 @@
   -- parse word “let” or “lexical”:
   --
   -- >>> parseTest (string "let" <|> string "lexical") "lexical"
-  -- parse error at line 1, column 1:
+  -- 1:1:
   -- unexpected "lex"
   -- expecting "let"
   --
@@ -391,7 +400,7 @@
   -- because Megaparsec's hint system can be used:
   --
   -- >>> parseTest (try (string "let") <|> string "lexical") "le"
-  -- parse error at line 1, column 1:
+  -- 1:1:
   -- unexpected "le"
   -- expecting "let" or "lexical"
 
@@ -652,7 +661,7 @@
 parseTest :: (Stream s t, Show a) => Parsec s a -> s -> IO ()
 parseTest p input =
   case parse p "" input of
-    Left err -> putStr "parse error at " >> print err
+    Left err -> print err
     Right x  -> print x
 
 -- | The most general way to run a parser over the 'Identity' monad.
diff --git a/Text/Megaparsec/String.hs b/Text/Megaparsec/String.hs
--- a/Text/Megaparsec/String.hs
+++ b/Text/Megaparsec/String.hs
@@ -36,4 +36,4 @@
 -- >     Right xs -> print (sum xs)
 
 parseFromFile :: Parser a -> String -> IO (Either ParseError a)
-parseFromFile p fname = runParser p fname <$> readFile fname
+parseFromFile p fname = runParser p fname `fmap` readFile fname
diff --git a/Text/Megaparsec/Text.hs b/Text/Megaparsec/Text.hs
--- a/Text/Megaparsec/Text.hs
+++ b/Text/Megaparsec/Text.hs
@@ -38,4 +38,4 @@
 -- >     Right xs -> print (sum xs)
 
 parseFromFile :: Parser a -> String -> IO (Either ParseError a)
-parseFromFile p fname = runParser p fname <$> T.readFile fname
+parseFromFile p fname = runParser p fname `fmap` T.readFile fname
diff --git a/Text/Megaparsec/Text/Lazy.hs b/Text/Megaparsec/Text/Lazy.hs
--- a/Text/Megaparsec/Text/Lazy.hs
+++ b/Text/Megaparsec/Text/Lazy.hs
@@ -38,4 +38,4 @@
 -- >     Right xs -> print (sum xs)
 
 parseFromFile :: Parser a -> String -> IO (Either ParseError a)
-parseFromFile p fname = runParser p fname <$> T.readFile fname
+parseFromFile p fname = runParser p fname `fmap` T.readFile fname
diff --git a/benchmarks/Main.hs b/benchmarks/Main.hs
--- a/benchmarks/Main.hs
+++ b/benchmarks/Main.hs
@@ -1,6 +1,6 @@
 -- -*- Mode: Haskell; -*-
 --
--- Criterion benmarks for Megaparsec, main module.
+-- Criterion benchmarks for Megaparsec, main module.
 --
 -- Copyright © 2015 Megaparsec contributors
 --
diff --git a/megaparsec.cabal b/megaparsec.cabal
--- a/megaparsec.cabal
+++ b/megaparsec.cabal
@@ -28,7 +28,7 @@
 -- possibility of such damage.
 
 name:                megaparsec
-version:             4.0.0
+version:             4.1.0
 cabal-version:       >= 1.10
 license:             BSD3
 license-file:        LICENSE.md
@@ -46,47 +46,18 @@
 
     This is industrial-strength monadic parser combinator library. Megaparsec is
     a fork of Parsec library originally written by Daan Leijen.
-    .
-    Megaparsec is different from Parsec in the following ways:
-    .
-    * Better error messages. We test our error messages using dense QuickCheck
-      tests. Good error messages are just as important for us as correct return
-      values of our parsers. Megaparsec will be especially useful if you write
-      compiler or interpreter for some language.
-    .
-    * Some quirks and “buggy features” (as well as plain bugs) of original
-      Parsec are fixed. There is no undocumented surprising stuff in Megaparsec.
-    .
-    * Better support for Unicode parsing in "Text.Megaparsec.Char".
-    .
-    * Megaparsec has more powerful combinators and can parse languages where
-      indentation matters.
-    .
-    * Comprehensive QuickCheck test suite covering nearly 100% of our code.
-    .
-    * We have benchmarks to detect performance regressions.
-    .
-    * Better documentation, with 100% of functions covered, without typos and
-      obsolete information, with working examples. Megaparsec's documentation is
-      well-structured and doesn't contain things useless to end user.
-    .
-    * Megaparsec's code is clearer and doesn't contain “magic” found in original
-      Parsec.
-    .
-    * Megaparsec looks into the future, it does not contain code that serves for
-      compatibility purposes, it also requires more recent version of `base`.
 
 extra-source-files:  AUTHORS.md, CHANGELOG.md
 
 library
-  build-depends:     base                   >= 4.8 && < 5
+  build-depends:     base                   >= 4.6 && < 5
                    , mtl                    == 2.*
                    , transformers           == 0.4.*
                    , bytestring
                    , text                   >= 0.2 && < 1.3
   default-extensions:
-                     DeriveDataTypeable
-                   , ExistentialQuantification
+                     CPP
+                   , DeriveDataTypeable
                    , FlexibleContexts
                    , FlexibleInstances
                    , FunctionalDependencies
@@ -125,13 +96,14 @@
                    , Bugs.Bug35
                    , Bugs.Bug39
                    , Util
-  build-depends:     base                   >= 4.8 && < 5
-                   , megaparsec             >= 4.0.0
+  build-depends:     base                   >= 4.6 && < 5
+                   , megaparsec             >= 4.1.0
                    , HUnit                  >= 1.2 && < 1.4
                    , test-framework         >= 0.6 && < 1
                    , test-framework-hunit   >= 0.2 && < 0.4
   default-extensions:
-                     FlexibleContexts
+                     CPP
+                   , FlexibleContexts
   default-language:  Haskell2010
 
 test-suite tests
@@ -148,15 +120,16 @@
                    , Pos
                    , Prim
                    , Util
-  build-depends:     base                   >= 4.8 && < 5
-                   , megaparsec             >= 4.0.0
+  build-depends:     base                   >= 4.6 && < 5
+                   , megaparsec             >= 4.1.0
                    , mtl                    == 2.*
                    , transformers           == 0.4.*
                    , QuickCheck             >= 2.4 && < 3
                    , test-framework         >= 0.6 && < 1
                    , test-framework-quickcheck2 >= 0.3 && < 0.4
   default-extensions:
-                     FlexibleContexts
+                     CPP
+                   , FlexibleContexts
                    , FlexibleInstances
   default-language:  Haskell2010
 
@@ -165,8 +138,8 @@
   hs-source-dirs:    benchmarks
   type:              exitcode-stdio-1.0
   ghc-options:       -O2 -Wall -rtsopts
-  build-depends:     base                   >= 4.8 && < 5
-                   , megaparsec             >= 4.0.0
+  build-depends:     base                   >= 4.6 && < 5
+                   , megaparsec             >= 4.1.0
                    , criterion              >= 0.6.2.1 && < 1.2
                    , text                   >= 1.2 && < 2
                    , bytestring             >= 0.10 && < 2
diff --git a/old-tests/Bugs/Bug39.hs b/old-tests/Bugs/Bug39.hs
--- a/old-tests/Bugs/Bug39.hs
+++ b/old-tests/Bugs/Bug39.hs
@@ -3,7 +3,9 @@
 
 import Control.Applicative (empty)
 import Control.Monad (void)
+#if MIN_VERSION_base(4,7,0)
 import Data.Either (isLeft, isRight)
+#endif
 
 import Text.Megaparsec
 import Text.Megaparsec.String
@@ -12,6 +14,14 @@
 import Test.Framework
 import Test.Framework.Providers.HUnit
 import Test.HUnit hiding (Test)
+
+#if !MIN_VERSION_base(4,7,0)
+isRight, isLeft :: Either a b -> Bool
+isRight (Right _) = True
+isRight _         = False
+isLeft  (Left _ ) = True
+isLeft  _         = False
+#endif
 
 shouldFail :: [String]
 shouldFail = [" 1", " +1", " -1"]
diff --git a/old-tests/Bugs/Bug9.hs b/old-tests/Bugs/Bug9.hs
--- a/old-tests/Bugs/Bug9.hs
+++ b/old-tests/Bugs/Bug9.hs
@@ -15,6 +15,10 @@
 
 import Util
 
+#if !MIN_VERSION_base(4,8,0)
+import Control.Applicative ((<$>), (<*), (<$))
+#endif
+
 data Expr = Const Integer | Op Expr Expr deriving Show
 
 main :: Test
diff --git a/tests/Char.hs b/tests/Char.hs
--- a/tests/Char.hs
+++ b/tests/Char.hs
@@ -42,6 +42,10 @@
 
 import Util
 
+#if !MIN_VERSION_base(4,8,0)
+import Control.Applicative ((<$>))
+#endif
+
 tests :: Test
 tests = testGroup "Character parsers"
         [ testProperty "newline"         prop_newline
@@ -75,7 +79,8 @@
         , testProperty "noneOf"          prop_noneOf
         , testProperty "noneOf'"         prop_noneOf'
         , testProperty "string"          prop_string
-        , testProperty "string'"         prop_string' ]
+        , testProperty "string'"         prop_string'_0
+        , testProperty "string' (case)"  prop_string'_1 ]
 
 instance Arbitrary GeneralCategory where
   arbitrary = elements
@@ -234,8 +239,21 @@
 prop_string :: String -> String -> Property
 prop_string a = checkString (string a) a (==) (showToken a)
 
-prop_string' :: String -> String -> Property
-prop_string' a = checkString (string' a) a casei (showToken a)
+prop_string'_0 :: String -> String -> Property
+prop_string'_0 a = checkString (string' a) a casei (showToken a)
+
+-- | Randomly change the case in the given string.
+
+fuzzyCase :: String -> Gen String
+fuzzyCase s = do
+    b <- vector (length s)
+    return $ zipWith f s b
+  where f k True  = if isLower k then toUpper k else toLower k
+        f k False = k
+
+prop_string'_1 :: String -> Property
+prop_string'_1 a = forAll (fuzzyCase a) $ \s ->
+  checkString (string' a) a casei (showToken a) s
 
 -- | Case-insensitive equality test for characters.
 
diff --git a/tests/Combinator.hs b/tests/Combinator.hs
--- a/tests/Combinator.hs
+++ b/tests/Combinator.hs
@@ -121,7 +121,6 @@
           | c == '-' && n == 0 = posErr 0 s [uneCh '-', exCh 'a']
           | c /= '-'           = posErr (g n) s $ uneCh c :
                                  [exCh '-' | n > 0] ++
-                                 -- [exEof    | n > 1] ++
                                  [exCh 'a' | n == 0]
           | otherwise = Right (replicate n 'a')
         s = intersperse '-' (replicate n 'a') ++ [c]
diff --git a/tests/Error.hs b/tests/Error.hs
--- a/tests/Error.hs
+++ b/tests/Error.hs
@@ -31,7 +31,9 @@
 
 module Error (tests) where
 
+#if MIN_VERSION_base(4,7,0)
 import Data.Bool (bool)
+#endif
 import Data.List (isPrefixOf, isInfixOf)
 
 import Test.Framework
@@ -41,6 +43,15 @@
 import Pos ()
 import Text.Megaparsec.Error
 import Text.Megaparsec.Pos
+
+#if !MIN_VERSION_base(4,8,0)
+import Control.Applicative ((<$>), (<*>))
+#endif
+#if !MIN_VERSION_base(4,7,0)
+bool :: a -> a -> Bool -> a
+bool f _ False = f
+bool _ t True  = t
+#endif
 
 tests :: Test
 tests = testGroup "Parse errors"
diff --git a/tests/Expr.hs b/tests/Expr.hs
--- a/tests/Expr.hs
+++ b/tests/Expr.hs
@@ -30,7 +30,9 @@
 module Expr (tests) where
 
 import Control.Applicative (some, (<|>))
+#if MIN_VERSION_base(4,7,0)
 import Data.Bool (bool)
+#endif
 
 import Test.Framework
 import Test.Framework.Providers.QuickCheck2 (testProperty)
@@ -43,6 +45,16 @@
 
 import Util
 
+#if !MIN_VERSION_base(4,8,0)
+import Control.Applicative ((<$>), (<*), (<*>), (*>), pure)
+#endif
+
+#if !MIN_VERSION_base(4,7,0)
+bool :: a -> a -> Bool -> a
+bool f _ False = f
+bool _ t True  = t
+#endif
+
 tests :: Test
 tests = testGroup "Expression parsers"
         [ testProperty "correctness of expression parser" prop_correctness ]
@@ -118,7 +130,7 @@
 arbitraryN2 n = elements [Sum,Sub,Pro,Div,Exp] <*> leaf <*> leaf
   where leaf = arbitraryN0 (n `div` 2)
 
--- Some helpers put here since we don't want to depend on
+-- Some helpers are put here since we don't want to depend on
 -- "Text.Megaparsec.Lexer".
 
 lexeme :: MonadParsec s m Char => m a -> m a
diff --git a/tests/Lexer.hs b/tests/Lexer.hs
--- a/tests/Lexer.hs
+++ b/tests/Lexer.hs
@@ -31,7 +31,9 @@
 
 import Control.Applicative (empty)
 import Control.Monad (void)
+#if MIN_VERSION_base(4,7,0)
 import Data.Bool (bool)
+#endif
 import Data.Char
   ( readLitChar
   , showLitChar
@@ -55,6 +57,15 @@
 import qualified Text.Megaparsec.Char as C
 
 import Util
+
+#if !MIN_VERSION_base(4,8,0)
+import Control.Applicative ((<$>), (<*), (<*>))
+#endif
+#if !MIN_VERSION_base(4,7,0)
+bool :: a -> a -> Bool -> a
+bool f _ False = f
+bool _ t True  = t
+#endif
 
 tests :: Test
 tests = testGroup "Lexer"
diff --git a/tests/Perm.hs b/tests/Perm.hs
--- a/tests/Perm.hs
+++ b/tests/Perm.hs
@@ -30,7 +30,9 @@
 module Perm (tests) where
 
 import Control.Applicative
+#if MIN_VERSION_base(4,7,0)
 import Data.Bool (bool)
+#endif
 import Data.List (nub, elemIndices)
 
 import Test.Framework
@@ -41,6 +43,11 @@
 import Text.Megaparsec.Perm
 
 import Util
+#if !MIN_VERSION_base(4,7,0)
+bool :: a -> a -> Bool -> a
+bool f _ False = f
+bool _ t True  = t
+#endif
 
 tests :: Test
 tests = testGroup "Permutation phrases parsers"
diff --git a/tests/Pos.hs b/tests/Pos.hs
--- a/tests/Pos.hs
+++ b/tests/Pos.hs
@@ -40,6 +40,10 @@
 
 import Text.Megaparsec.Pos
 
+#if !MIN_VERSION_base(4,8,0)
+import Control.Applicative ((<$>), (<*>), pure)
+#endif
+
 tests :: Test
 tests = testGroup "Textual source positions"
         [ testProperty "components" prop_components
@@ -71,20 +75,13 @@
   where copy = newPos (sourceName pos) (sourceLine pos) (sourceColumn pos)
 
 prop_showFileName :: SourcePos -> Bool
-prop_showFileName pos =
-  if null name
-  then '"'`notElem` shown
-  else ("\"" ++ name ++ "\"") `isInfixOf` shown
-  where name  = sourceName pos
-        shown = show pos
+prop_showFileName pos = sourceName pos `isInfixOf` show pos
 
 prop_showLine :: SourcePos -> Bool
-prop_showLine pos = ("line " ++ line) `isInfixOf` show pos
-  where line = show $ sourceLine pos
+prop_showLine pos = show (sourceLine pos) `isInfixOf` show pos
 
 prop_showColumn :: SourcePos -> Bool
-prop_showColumn pos = ("column " ++ column) `isInfixOf` show pos
-  where column = show $ sourceColumn pos
+prop_showColumn pos = show (sourceColumn pos) `isInfixOf` show pos
 
 prop_initialPos :: String -> Bool
 prop_initialPos n =
diff --git a/tests/Prim.hs b/tests/Prim.hs
--- a/tests/Prim.hs
+++ b/tests/Prim.hs
@@ -32,7 +32,9 @@
 module Prim (tests) where
 
 import Control.Applicative
+#if MIN_VERSION_base(4,7,0)
 import Data.Bool (bool)
+#endif
 import Data.Char (isLetter, toUpper)
 import Data.Foldable (asum)
 import Data.List (isPrefixOf)
@@ -57,6 +59,11 @@
 
 import Pos ()
 import Util
+#if !MIN_VERSION_base(4,7,0)
+bool :: a -> a -> Bool -> a
+bool f _ False = f
+bool _ t True  = t
+#endif
 
 tests :: Test
 tests = testGroup "Primitive parser combinators"
diff --git a/tests/Util.hs b/tests/Util.hs
--- a/tests/Util.hs
+++ b/tests/Util.hs
@@ -58,6 +58,10 @@
 import Text.Megaparsec.ShowToken
 import Text.Megaparsec.String
 
+#if !MIN_VERSION_base(4,8,0)
+import Control.Applicative ((<$>), (<*))
+#endif
+
 -- | @checkParser p r s@ tries to run parser @p@ on input @s@ to parse
 -- entire @s@. Result of the parsing is compared with expected result @r@,
 -- it should match, otherwise the property doesn't hold and the test fails.
@@ -97,7 +101,7 @@
 checkString :: Parser String -> String -> (Char -> Char -> Bool)
             -> String -> String -> Property
 checkString p a' test l s' = checkParser p (w a' 0 s') s'
-  where w [] _ []    = Right a'
+  where w [] _ []    = Right s'
         w [] i (s:_) = posErr i s' [uneCh s, exEof]
         w _  0 []    = posErr 0 s' [uneEof, exSpec l]
         w _  i []    = posErr 0 s' [uneStr (take i s'), exSpec l]
@@ -106,7 +110,7 @@
           | otherwise = posErr 0 s' [uneStr (take i' s'), exSpec l]
             where i'  = succ i
 
-infix 4 /=\
+infix 4 /=\   -- preserve whitespace on automatic trim
 
 -- | @p /=\\ x@ runs parser @p@ on empty input and compares its result
 -- (which should be successful) with @x@. Succeeds when the result is equal
