Skip to content
This repository was archived by the owner on Feb 3, 2021. It is now read-only.

Commit 9d8b59d

Browse files
committed
Merge pull request #28 from YoshikuniJujo/master
new exception system
2 parents 281b626 + cbf5153 commit 9d8b59d

File tree

5 files changed

+11
-6
lines changed

5 files changed

+11
-6
lines changed

pugs-DrIFT/pugs-DrIFT.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: pugs-DrIFT
2-
version: 2.2.3.20120717
2+
version: 2.2.3.20120717.1
33
synopsis: DrIFT with pugs-specific rules.
44
description: DrIFT is a type sensitive preprocessor for Haskell. It extracts type declarations
55
and directives from modules. The directives cause rules to be fired on the parsed

pugs-DrIFT/src/ChaseImports.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ import Data.List
2929
import qualified Unlit
3030
import Control.Monad
3131
import GenUtil
32+
import Control.Exception(catch, SomeException)
3233

33-
try x = catch (x >>= return . Right) (return . Left)
34+
try x = catch (x >>= return . Right) (\e -> return $ Left (e :: SomeException))
3435

3536
--- Split up input ---------------------------------------------------------
3637
splitString :: String -> String -> (String,String)

pugs-DrIFT/src/GenUtil.hs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE ScopedTypeVariables #-}
12

23
-- $Id: GenUtil.hs,v 1.30 2004/12/01 23:58:27 john Exp $
34
-- arch-tag: 835e46b7-8ffd-40a0-aaf9-326b7e347760
@@ -101,6 +102,7 @@ import qualified System.Environment as System
101102
import qualified System.Exit as System
102103
import System.Random(StdGen, newStdGen, Random(randomR))
103104
import System.Time
105+
import Control.Exception
104106

105107
{-# SPECIALIZE snub :: [String] -> [String] #-}
106108
{-# SPECIALIZE snub :: [Int] -> [Int] #-}
@@ -286,10 +288,10 @@ lefts :: [Either a b] -> [a]
286288
lefts xs = [x | Left x <- xs]
287289

288290
ioM :: Monad m => IO a -> IO (m a)
289-
ioM action = catch (fmap return action) (\e -> return (fail (show e)))
291+
ioM action = catch (fmap return action) (\(e :: SomeException) -> return (fail (show e)))
290292

291293
ioMp :: MonadPlus m => IO a -> IO (m a)
292-
ioMp action = catch (fmap return action) (\_ -> return mzero)
294+
ioMp action = catch (fmap return action) (\(_ :: SomeException) -> return mzero)
293295

294296
-- | reformat a string to not be wider than a given width, breaking it up
295297
-- between words.

pugs-compat/pugs-compat.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Name : pugs-compat
2-
Version : 0.0.6.20130209.0
2+
Version : 0.0.6.20130209.0.1
33
Build-type : Simple
44
Category : Pugs
55
License : PublicDomain

pugs-compat/src/Pugs/Compat/Posix.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ import Foreign.C.Types
6767
import Foreign.C.String
6868
import Data.Typeable
6969
import qualified System.Posix.Signals
70+
import Control.Exception
7071

7172
_PUGS_HAVE_POSIX :: Bool
7273
_PUGS_HAVE_POSIX = True
@@ -75,7 +76,8 @@ doesExist :: FilePath -> IO Bool
7576
doesExist = fileExist
7677

7778
testStatusWith :: (FileStatus -> Bool) -> FilePath -> IO Bool
78-
testStatusWith t f = fmap t (getFileStatus f) `catch` const (return False)
79+
testStatusWith t f = fmap t (getFileStatus f) `catch`
80+
(const (return False) :: SomeException -> IO Bool)
7981

8082
doesFileExist :: FilePath -> IO Bool
8183
doesFileExist = testStatusWith isRegularFile

0 commit comments

Comments
 (0)