diff --git a/NgxExport.hs b/NgxExport.hs
--- a/NgxExport.hs
+++ b/NgxExport.hs
@@ -61,20 +61,26 @@
 import           Paths_ngx_export (version)
 import           Data.Version
 
+#if MIN_TOOL_VERSION_ghc(8,0,1)
+#define EMPTY_CPROV
+#else
+#define EMPTY_CPROV () =>
+#endif
+
 #if MIN_VERSION_template_haskell(2,11,0)
-#define DERIV_CLAUSE _
+#define PLACEHOLDER_BEFORE_CON _
 #else
-#define DERIV_CLAUSE
+#define PLACEHOLDER_BEFORE_CON
 #endif
 
-pattern I :: (Num i, Integral a) => i -> a
+pattern I :: EMPTY_CPROV (Num i, Integral a) => i -> a
 pattern I i <- (fromIntegral -> i)
 {-# COMPLETE I :: CInt #-}
 
-pattern PtrLen :: (Num i, Integral a) => Ptr s -> i -> (Ptr s, a)
+pattern PtrLen :: EMPTY_CPROV (Num i, Integral a) => Ptr s -> i -> (Ptr s, a)
 pattern PtrLen s l <- (s, I l)
 
-pattern ToBool :: (Num i, Eq i) => Bool -> i
+pattern ToBool :: EMPTY_CPROV (Num i, Eq i) => Bool -> i
 pattern ToBool i <- (toBool -> i)
 {-# COMPLETE ToBool :: CUInt #-}
 
@@ -93,7 +99,7 @@
                                     (B.ByteString, B.ByteString, Int))
 
 let name = mkName "exportType" in do
-    TyConI (DataD _ _ _ _ cs DERIV_CLAUSE) <- reify ''NgxExport
+    TyConI (DataD _ _ _ PLACEHOLDER_BEFORE_CON cs _) <- reify ''NgxExport
     let cons = map (\(NormalC con [(_, typ)]) -> (con, typ)) cs
     sequence $
         [sigD name [t|NgxExport -> IO CInt|],
diff --git a/ngx-export.cabal b/ngx-export.cabal
--- a/ngx-export.cabal
+++ b/ngx-export.cabal
@@ -1,5 +1,5 @@
 name:                       ngx-export
-version:                    0.8.0.3
+version:                    0.8.0.4
 synopsis:                   Helper module for Nginx haskell module
 description:                Helper module for
         <http://github.com/lyokha/nginx-haskell-module Nginx haskell module>
