#!/usr/bin/env runhaskell
\begin{code}
-{-# OPTIONS -Wall #-}
+{-# OPTIONS -Wall -cpp #-}
-import Control.Exception
import Control.Monad
import Distribution.PackageDescription
import Distribution.Simple
import System.FilePath
import System.Exit
import System.Directory
-import Control.Exception (try)
+import Control.Exception
main :: IO ()
main = do
r <- rawSystem "cmp" ["-s" {-quiet-}, source, target]
case r of
ExitSuccess -> removeFile source
- ExitFailure _ -> do (try :: IO () -> IO (Either IOException ())) (removeFile target); renameFile source target
-
-
+ ExitFailure _ -> do
+#if __GLASGOW_HASKELL__ >= 610
+ (try :: IO () -> IO (Either IOException ()))
+#else
+ try
+#endif
+ (removeFile target)
+ renameFile source target
\end{code}
\ No newline at end of file