Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

* 'master' of github.com:simonmar/parconc-examples:
  add sigs
  • Loading branch information...
commit 300adf1e0128d666dbfc452103d11695706ae2f7 2 parents e434ec0 + f216bb8
@simonmar authored
Showing with 5 additions and 0 deletions.
  1. +4 −0 timeout.hs
  2. +1 −0  timeout2.hs
View
4 timeout.hs
@@ -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
1  timeout2.hs
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.