diff --git a/LICENSE b/LICENSE
--- a/LICENSE
+++ b/LICENSE
@@ -5,11 +5,11 @@
 
 - Redistributions of source code must retain the above copyright notice,
 this list of conditions and the following disclaimer.
- 
+
 - Redistributions in binary form must reproduce the above copyright notice,
 this list of conditions and the following disclaimer in the documentation
 and/or other materials provided with the distribution.
- 
+
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS "AS IS" AND ANY
 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
diff --git a/haddock-library.cabal b/haddock-library.cabal
--- a/haddock-library.cabal
+++ b/haddock-library.cabal
@@ -1,5 +1,5 @@
 name:                 haddock-library
-version:              1.2.1
+version:              1.4.1
 synopsis:             Library exposing some functionality of Haddock.
 description:          Haddock is a documentation-generation tool for Haskell
                       libraries. These modules expose some functionality of it
@@ -21,7 +21,7 @@
   default-language:     Haskell2010
 
   build-depends:
-      base >= 4.5 && < 4.9
+      base >= 4.5 && < 4.10
     , bytestring
     , transformers
     , deepseq
diff --git a/src/Documentation/Haddock/Parser.hs b/src/Documentation/Haddock/Parser.hs
--- a/src/Documentation/Haddock/Parser.hs
+++ b/src/Documentation/Haddock/Parser.hs
@@ -73,6 +73,8 @@
     g (DocCodeBlock x) = DocCodeBlock $ g x
     g (DocHyperlink x) = DocHyperlink x
     g (DocPic x) = DocPic x
+    g (DocMathInline x) = DocMathInline x
+    g (DocMathDisplay x) = DocMathDisplay x
     g (DocAName x) = DocAName x
     g (DocProperty x) = DocProperty x
     g (DocExamples x) = DocExamples x
@@ -113,7 +115,9 @@
   where
     p :: Parser (DocH mod Identifier)
     p = docConcat <$> many (monospace <|> anchor <|> identifier <|> moduleName
-                            <|> picture <|> markdownImage <|> hyperlink <|> bold
+                            <|> picture <|> mathDisplay <|> mathInline
+                            <|> markdownImage
+                            <|> hyperlink <|> bold
                             <|> emphasis <|> encodedChar <|> string'
                             <|> skipSpecialChar)
 
@@ -223,6 +227,22 @@
 picture :: Parser (DocH mod a)
 picture = DocPic . makeLabeled Picture . decodeUtf8
           <$> disallowNewline ("<<" *> takeUntil ">>")
+
+-- | Inline math parser, surrounded by \\( and \\).
+--
+-- >>> parseString "\\(\\int_{-\\infty}^{\\infty} e^{-x^2/2} = \\sqrt{2\\pi}\\)"
+-- DocMathInline "\\int_{-\\infty}^{\\infty} e^{-x^2/2} = \\sqrt{2\\pi}"
+mathInline :: Parser (DocH mod a)
+mathInline = DocMathInline . decodeUtf8
+             <$> disallowNewline  ("\\(" *> takeUntil "\\)")
+
+-- | Display math parser, surrounded by \\[ and \\].
+--
+-- >>> parseString "\\[\\int_{-\\infty}^{\\infty} e^{-x^2/2} = \\sqrt{2\\pi}\\]"
+-- DocMathDisplay "\\int_{-\\infty}^{\\infty} e^{-x^2/2} = \\sqrt{2\\pi}"
+mathDisplay :: Parser (DocH mod a)
+mathDisplay = DocMathDisplay . decodeUtf8
+              <$> ("\\[" *> takeUntil "\\]")
 
 markdownImage :: Parser (DocH mod a)
 markdownImage = fromHyperlink <$> ("!" *> linkParser)
diff --git a/src/Documentation/Haddock/Types.hs b/src/Documentation/Haddock/Types.hs
--- a/src/Documentation/Haddock/Types.hs
+++ b/src/Documentation/Haddock/Types.hs
@@ -71,6 +71,8 @@
   | DocCodeBlock (DocH mod id)
   | DocHyperlink Hyperlink
   | DocPic Picture
+  | DocMathInline String
+  | DocMathDisplay String
   | DocAName String
   | DocProperty String
   | DocExamples [Example]
diff --git a/test/Documentation/Haddock/ParserSpec.hs b/test/Documentation/Haddock/ParserSpec.hs
--- a/test/Documentation/Haddock/ParserSpec.hs
+++ b/test/Documentation/Haddock/ParserSpec.hs
@@ -208,6 +208,10 @@
       it "supports title for deprecated picture syntax" $ do
         "<<b a z>>" `shouldParseTo` image "b" "a z"
 
+    context "when parsing display math" $ do
+
+      it "accepts markdown syntax for display math containing newlines" $ do
+         "\\[\\pi\n\\pi\\]" `shouldParseTo` DocMathDisplay "\\pi\n\\pi"
 
     context "when parsing anchors" $ do
       it "parses a single word anchor" $ do
diff --git a/vendor/attoparsec-0.12.1.1/Data/Attoparsec/Internal/Types.hs b/vendor/attoparsec-0.12.1.1/Data/Attoparsec/Internal/Types.hs
--- a/vendor/attoparsec-0.12.1.1/Data/Attoparsec/Internal/Types.hs
+++ b/vendor/attoparsec-0.12.1.1/Data/Attoparsec/Internal/Types.hs
@@ -126,7 +126,7 @@
       where msg = "Failed reading: " ++ err
     {-# INLINE fail #-}
 
-    return v = Parser $ \t pos more _lose succ -> succ t pos more v
+    return = pure
     {-# INLINE return #-}
 
     m >>= k = Parser $ \t !pos more lose succ ->
@@ -158,7 +158,7 @@
 {-# INLINE apP #-}
 
 instance Applicative (Parser i) where
-    pure   = return
+    pure v = Parser $ \t pos more _lose succ -> succ t pos more v
     {-# INLINE pure #-}
     (<*>)  = apP
     {-# INLINE (<*>) #-}
@@ -166,7 +166,7 @@
     -- These definitions are equal to the defaults, but this
     -- way the optimizer doesn't have to work so hard to figure
     -- that out.
-    (*>)   = (>>)
+    m *> k = m >>= \_ -> k
     {-# INLINE (*>) #-}
     x <* y = x >>= \a -> y >> return a
     {-# INLINE (<*) #-}
