diff --git a/hspec-discover.cabal b/hspec-discover.cabal
--- a/hspec-discover.cabal
+++ b/hspec-discover.cabal
@@ -1,5 +1,5 @@
 name:             hspec-discover
-version:          0.0.1
+version:          0.0.2
 license:          MIT
 license-file:     LICENSE
 copyright:        (c) 2012 Simon Hengel
@@ -16,6 +16,15 @@
   location: https://github.com/sol/hspec-discover
 
 library
+  ghc-options:
+      -Wall
+  hs-source-dirs:
+      src
+  exposed-modules:
+      Test.Hspec.Discover
+  build-depends:
+      base >= 4 && <= 5
+    , hspec == 1.1.*
 
 executable hspec-discover
   ghc-options:
@@ -30,7 +39,6 @@
       base >= 4 && <= 5
     , filepath
     , directory
-    , hspec == 1.1.*
 
 test-suite spec
   type:
diff --git a/src/Run.hs b/src/Run.hs
--- a/src/Run.hs
+++ b/src/Run.hs
@@ -24,7 +24,7 @@
       ["--nested"] -> return True
       _            -> exit
     specs <- findSpecs src
-    writeFile dst (mkSpecModule nested specs)
+    writeFile dst (mkSpecModule src nested specs)
   _ -> exit
   where
     exit = do
@@ -32,13 +32,14 @@
       hPutStrLn stderr ("usage: " ++ name ++ " SRC CUR DST [--nested]")
       exitFailure
 
-mkSpecModule :: Bool -> [SpecNode] -> String
-mkSpecModule nested nodes =
-  ( showString "module Main where\n"
-  . showString "import Test.Hspec.Monadic\n"
+mkSpecModule :: FilePath -> Bool -> [SpecNode] -> String
+mkSpecModule src nested nodes =
+  ( "{-# LINE 1 " . shows src . " #-}"
+  . showString "module Main where\n"
+  . showString "import Test.Hspec.Discover\n"
   . importList nodes
   . showString "main :: IO ()\n"
-  . showString "main = hspecX $ "
+  . showString "main = hspec $ "
   . format nodes
   ) "\n"
   where
diff --git a/src/Test/Hspec/Discover.hs b/src/Test/Hspec/Discover.hs
new file mode 100644
--- /dev/null
+++ b/src/Test/Hspec/Discover.hs
@@ -0,0 +1,7 @@
+{-# OPTIONS_HADDOCK hide #-}
+module Test.Hspec.Discover (hspec, describe) where
+
+import Test.Hspec.Monadic (Specs, hspecX, describe)
+
+hspec :: Specs -> IO ()
+hspec = hspecX
