diff --git a/.travis.yml b/.travis.yml
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,7 +2,8 @@
  - GHCVER=7.4.2 CABALVER=1.16
  - GHCVER=7.6.3 CABALVER=1.18
  - GHCVER=7.8.3 CABALVER=1.20
- - GHCVER=head CABALVER=1.20
+ - GHCVER=7.10.2 CABALVER=1.22
+ - GHCVER=head CABALVER=1.22
 
 before_install:
  - sudo add-apt-repository -y ppa:hvr/ghc
@@ -21,5 +22,5 @@
 
 matrix:
   allow_failures:
-   - env: GHCVER=head CABALVER=1.20
+   - env: GHCVER=head CABALVER=1.22
   fast_finish: true
diff --git a/haskell-generate.cabal b/haskell-generate.cabal
--- a/haskell-generate.cabal
+++ b/haskell-generate.cabal
@@ -1,5 +1,5 @@
 name:          haskell-generate
-version:       0.2.3
+version:       0.2.4
 license:       BSD3
 category:      Code Generation, Language
 cabal-version: >= 1.10
@@ -56,6 +56,4 @@
     , doctest >= 0.9.1
     , filepath
   ghc-options: -Wall -threaded
-  if impl(ghc<7.6.1)
-    ghc-options: -Werror
   hs-source-dirs: tests
diff --git a/src/Language/Haskell/Generate/Monad.hs b/src/Language/Haskell/Generate/Monad.hs
--- a/src/Language/Haskell/Generate/Monad.hs
+++ b/src/Language/Haskell/Generate/Monad.hs
@@ -36,6 +36,8 @@
 import           Language.Haskell.Exts.Syntax
 import           Language.Haskell.Generate.Expression
 
+import Prelude
+
 --------------------------------------------------------------------------------
 -- Generate expressions
 
@@ -62,9 +64,11 @@
 caseE :: ExpG x -> [(Pat, ExpG t)] -> ExpG t
 caseE v alt = do
   v' <- v
-#if MIN_VERSION_haskell_src_exts(1,16,0)   
+#if MIN_VERSION_haskell_src_exts(1,17,0)
+  alt' <- mapM (\(p,a) -> fmap (\a' -> Alt noLoc p (UnGuardedRhs $ runExpression a') Nothing) a) alt
+#elif MIN_VERSION_haskell_src_exts(1,16,0)
   alt' <- mapM (\(p,a) -> fmap (\a' -> Alt noLoc p (UnGuardedRhs $ runExpression a') (BDecls [])) a) alt
-#else  
+#else
   alt' <- mapM (\(p,a) -> fmap (\a' -> Alt noLoc p (UnGuardedAlt $ runExpression a') (BDecls [])) a) alt
 #endif
   return $ Expression $ Case (runExpression v') alt'
@@ -210,7 +214,7 @@
 
 -- | Generate a ExportSpec for a given function item.
 exportFun :: FunRef t -> ExportSpec 
-#if MIN_VERSION_haskell_src_exts(1,16,0) 
+#if MIN_VERSION_haskell_src_exts(1,16,0) && !MIN_VERSION_haskell_src_exts(1,17,0)
 exportFun (FunRef name) = EVar NoNamespace (UnQual name)  
 #else
 exportFun (FunRef name) = EVar (UnQual name)
@@ -220,7 +224,11 @@
 addDecl :: Name -> ExpG t -> ModuleM (FunRef t)
 addDecl name e = ModuleM $ do
   let (body, mods) = runGenerate e
+#if MIN_VERSION_haskell_src_exts(1,17,0)
+  tell (mods, [FunBind [Match noLoc name [] Nothing (UnGuardedRhs $ runExpression body) Nothing]])
+#else
   tell (mods, [FunBind [Match noLoc name [] Nothing (UnGuardedRhs $ runExpression body) $ BDecls []]])
+#endif
   return $ FunRef name
 
 -- | Extract the Module from a module generator.
diff --git a/tests/doctests.hsc b/tests/doctests.hsc
--- a/tests/doctests.hsc
+++ b/tests/doctests.hsc
@@ -20,18 +20,17 @@
 import System.Directory
 import System.FilePath
 import Test.DocTest
+import Prelude
 
 ##ifdef mingw32_HOST_ARCH
 ##ifdef i386_HOST_ARCH
 ##define USE_CP
-import Control.Applicative
 import Control.Exception
 import Foreign.C.Types
 foreign import stdcall "windows.h SetConsoleCP" c_SetConsoleCP :: CUInt -> IO Bool
 foreign import stdcall "windows.h GetConsoleCP" c_GetConsoleCP :: IO CUInt
 ##elif defined(x86_64_HOST_ARCH)
 ##define USE_CP
-import Control.Applicative
 import Control.Exception
 import Foreign.C.Types
 foreign import ccall "windows.h SetConsoleCP" c_SetConsoleCP :: CUInt -> IO Bool
