Permalink
Browse files

Merge branch 'master' of github.com:simonmar/parconc-examples

* 'master' of github.com:simonmar/parconc-examples:
  add sigs
  • Loading branch information...
2 parents e434ec0 + f216bb8 commit 300adf1e0128d666dbfc452103d11695706ae2f7 @simonmar committed Mar 6, 2013
Showing with 5 additions and 0 deletions.
  1. +4 −0 timeout.hs
  2. +1 −0 timeout2.hs
View
@@ -11,6 +11,10 @@ instance Show Timeout where
instance Exception Timeout
+-- <<timeout-sig
+timeout :: Int -> IO a -> IO (Maybe a)
+-- >>
+
-- <<timeout
timeout t m
| t < 0 = fmap Just m -- <1>
View
@@ -6,6 +6,7 @@ import Data.Typeable
import Control.Concurrent.Async
-- <<timeout
+timeout :: Int -> IO a -> IO (Maybe a)
timeout n m
| n < 0 = fmap Just m
| n == 0 = return Nothing

0 comments on commit 300adf1

Please sign in to comment.