diff --git a/src/Language/Haskell/Stylish/Parse.hs b/src/Language/Haskell/Stylish/Parse.hs
--- a/src/Language/Haskell/Stylish/Parse.hs
+++ b/src/Language/Haskell/Stylish/Parse.hs
@@ -40,18 +40,24 @@
 parseModule :: Extensions -> Maybe FilePath -> String -> Either String Module
 parseModule extraExts mfp string = do
     -- Determine the extensions: those specified in the file and the extra ones
-    let noBom      = dropBom string
-        extraExts' = map H.classifyExtension extraExts
-        fileExts   = fromMaybe [] $ H.readExtensions noBom
-        exts       = fileExts ++ extraExts'
+    let noBom            = dropBom string
+        extraExts'       = map H.classifyExtension extraExts
+        (lang, fileExts) = fromMaybe (Nothing, []) $ H.readExtensions noBom
+        exts             = fileExts ++ extraExts'
 
         -- Parsing options...
         fp       = fromMaybe "<unknown>" mfp
         mode     = H.defaultParseMode
-            {H.extensions = exts, H.fixities = Nothing}
+            { H.extensions   = exts
+            , H.fixities     = Nothing
+            , H.baseLanguage = case lang of
+                Nothing -> H.baseLanguage H.defaultParseMode
+                Just l  -> l
+            }
 
         -- Preprocessing
-        noCpp    = if H.CPP `elem` exts then unCpp noBom else noBom
+        noCpp    =
+            if H.EnableExtension H.CPP `elem` exts then unCpp noBom else noBom
 
     case H.parseModuleWithComments mode noCpp of
         H.ParseOk md -> return md
diff --git a/stylish-haskell.cabal b/stylish-haskell.cabal
--- a/stylish-haskell.cabal
+++ b/stylish-haskell.cabal
@@ -1,5 +1,5 @@
 Name:          stylish-haskell
-Version:       0.5.7.0
+Version:       0.5.8.0
 Synopsis:      Haskell code prettifier
 Homepage:      https://github.com/jaspervdj/stylish-haskell
 License:       BSD3
@@ -49,7 +49,7 @@
     containers       >= 0.3  && < 0.6,
     directory        >= 1.1  && < 1.3,
     filepath         >= 1.1  && < 1.4,
-    haskell-src-exts >= 1.13 && < 1.14,
+    haskell-src-exts >= 1.14 && < 1.15,
     mtl              >= 2.0  && < 2.2,
     syb              >= 0.3  && < 0.5,
     yaml             >= 0.7  && < 0.9
@@ -70,7 +70,7 @@
     containers       >= 0.3  && < 0.6,
     directory        >= 1.1  && < 1.3,
     filepath         >= 1.1  && < 1.4,
-    haskell-src-exts >= 1.13 && < 1.14,
+    haskell-src-exts >= 1.14 && < 1.15,
     mtl              >= 2.0  && < 2.2,
     syb              >= 0.3  && < 0.5,
     yaml             >= 0.7  && < 0.9
@@ -103,7 +103,7 @@
     containers       >= 0.3  && < 0.6,
     directory        >= 1.1  && < 1.3,
     filepath         >= 1.1  && < 1.4,
-    haskell-src-exts >= 1.13 && < 1.14,
+    haskell-src-exts >= 1.14 && < 1.15,
     mtl              >= 2.0  && < 2.2,
     syb              >= 0.3  && < 0.5,
     yaml             >= 0.7  && < 0.9
diff --git a/tests/Language/Haskell/Stylish/Parse/Tests.hs b/tests/Language/Haskell/Stylish/Parse/Tests.hs
--- a/tests/Language/Haskell/Stylish/Parse/Tests.hs
+++ b/tests/Language/Haskell/Stylish/Parse/Tests.hs
@@ -20,6 +20,7 @@
     [ testCase "UTF-8 Byte Order Mark" testBom
     , testCase "Extra extensions"      testExtraExtensions
     , testCase "Multiline CPP"         testMultilineCpp
+    , testCase "Haskell2010 extension" testHaskell2010
     ]
 
 
@@ -45,6 +46,15 @@
     [ "{-# LANGUAGE CPP #-}"
     , "#define foo bar \\"
     , "             qux"
+    ]
+
+
+--------------------------------------------------------------------------------
+testHaskell2010 :: Assertion
+testHaskell2010 = assert $ isRight $ parseModule [] Nothing $ unlines
+    [ "{-# LANGUAGE Haskell2010 #-}"
+    , "module X where"
+    , "foo x | Just y <- x = y"
     ]
 
 
