~ubuntu-branches/ubuntu/saucy/haskell-quickcheck/saucy-proposed

« back to all changes in this revision

Viewing changes to Test/QuickCheck/Exception.hs

  • Committer: Bazaar Package Importer
  • Author(s): Iain Lane, Iain Lane, Joachim Breitner
  • Date: 2009-12-27 16:21:45 UTC
  • mfrom: (8.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20091227162145-o5j9zurdrauy3yp3
[ Iain Lane ]
* New upstream release 2.1.0.2
* debian/control:
  + Switch to team maintenance — thanks to Kari Pahula for previous
    maintainership.
  + Add myself to Uploaders.
  + Update Standards-Version to 3.8.3, no changes required. 

[ Joachim Breitner ]
* really add debian/watch file

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{-# LANGUAGE CPP #-}
1
2
module Test.QuickCheck.Exception where
2
3
 
 
4
#if defined(MIN_VERSION_base)
 
5
#if !(MIN_VERSION_base(4,0,0))
 
6
#define SomeException Exception
 
7
#endif
 
8
#endif
 
9
 
 
10
#if defined(__GLASGOW_HASKELL__) && (__GLASGOW_HASKELL__ < 609)
 
11
#define SomeException Exception
 
12
#endif
 
13
 
3
14
import Control.Exception
4
15
  ( evaluate
5
16
  , try
6
 
  , Exception
 
17
  , SomeException
7
18
  )
8
19
 
9
20
--------------------------------------------------------------------------
10
21
-- try evaluate
11
22
 
12
 
tryEvaluate :: a -> IO (Either Exception a)
 
23
tryEvaluate :: a -> IO (Either SomeException a)
13
24
tryEvaluate x = tryEvaluateIO (return x)
14
25
 
15
 
tryEvaluateIO :: IO a -> IO (Either Exception a)
 
26
tryEvaluateIO :: IO a -> IO (Either SomeException a)
16
27
tryEvaluateIO m = try (m >>= evaluate)
17
28
--tryEvaluateIO m = Right `fmap` m
18
29