Commit 47733f31 authored by basvandijk's avatar basvandijk
Browse files

Use catch from the Prelude in the auto generated Paths_pkgname module

This enables it to be build with GHC-6.8
parent c3a0557f
......@@ -72,16 +72,12 @@ generate pkg_descr lbi =
" ) where\n"++
"\n"++
foreign_imports++
"import qualified Control.Exception as Exception\n"++
"import Prelude (catch, IO, FilePath, return, (++))\n"++
"import Data.Version (Version(..))\n"++
"import System.Environment (getEnv)"++
"\n"++
"\nversion :: Version"++
"\nversion = " ++ show (packageVersion pkg_descr)++
"\n"++
"\n"++
"catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a\n"++
"catchIO = Exception.catch\n"
"\nversion = " ++ show (packageVersion pkg_descr)
body
| absolute =
......@@ -144,7 +140,7 @@ generate pkg_descr lbi =
mkGetDir _ (Just dirrel) = "getPrefixDirRel " ++ show dirrel
mkGetDir dir Nothing = "return " ++ show dir
mkGetEnvOr var expr = "catchIO (getEnv \""++var'++"\")"++
mkGetEnvOr var expr = "catch (getEnv \""++var'++"\")"++
" (\\_ -> "++expr++")"
where var' = pkgPathEnvVar pkg_descr var
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment