diff --git a/hslua.cabal b/hslua.cabal
--- a/hslua.cabal
+++ b/hslua.cabal
@@ -1,5 +1,5 @@
 Name: hslua
-Version: 0.3.5
+Version: 0.3.6
 Stability: beta
 Cabal-version: >= 1.6
 License: BSD3
diff --git a/src/Scripting/Lua.hs b/src/Scripting/Lua.hs
--- a/src/Scripting/Lua.hs
+++ b/src/Scripting/Lua.hs
@@ -1,5 +1,5 @@
 
-{-# LANGUAGE ForeignFunctionInterface, TypeSynonymInstances, FlexibleInstances #-}
+{-# LANGUAGE ForeignFunctionInterface, TypeSynonymInstances, FlexibleInstances, ScopedTypeVariables #-}
 {-# OPTIONS_GHC -Wall -fno-warn-name-shadowing -fno-warn-unused-do-bind -fno-warn-unused-binds #-}
 -- |
 -- Module      : Scripting.Lua
@@ -176,11 +176,12 @@
     registerhsfunction
 )
 where
-import Prelude hiding (concat)
+import Prelude hiding (concat, catch)
 import Foreign.C
 import Foreign.Ptr
 import Foreign.StablePtr
 import Control.Monad
+import Control.Exception
 import Foreign.Marshal.Alloc
 import Data.IORef
 import qualified Foreign.Storable as F
@@ -961,7 +962,7 @@
 -- Any Haskell exception will be converted to a string and returned
 -- as Lua error.
 luaimport :: LuaImport a => a -> LuaCFunction
-luaimport a l = luaimport' 1 a l `catch` (\e -> push l (show e) >> return (-1))
+luaimport a l = luaimport' 1 a l `catch` (\(e :: IOError) -> push l (show e) >> return (-1))
 
 -- | Free function pointer created with @newcfunction@.
 freecfunction :: FunPtr LuaCFunction -> IO ()
