Skip to content

Commit 24c9b7e

Browse files
committed
Provide minimal haddock comments for MonadDelay
I have spent some time figuring out why my code wasn't working anymore after I upgraded io-classes version, until I realised the threadDelay was not taking a DiffTime anymore but an Int as number of us.
1 parent 892076e commit 24c9b7e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

io-classes/src/Control/Monad/Class/MonadTimer.hs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
{-# LANGUAGE ScopedTypeVariables #-}
55
{-# LANGUAGE TypeFamilies #-}
66

7+
-- | Provides classes to handle delays and timeouts.
78
module Control.Monad.Class.MonadTimer
89
( MonadDelay (..)
910
, MonadTimer (..)
@@ -18,13 +19,22 @@ import Control.Monad.Trans (lift)
1819

1920
import qualified System.Timeout as IO
2021

22+
-- | A typeclass to delay current thread.
2123
class Monad m => MonadDelay m where
24+
25+
-- | Suspends the current thread for a given number of microseconds
26+
-- (GHC only).
27+
--
28+
-- See `IO.threadDelay`.
2229
threadDelay :: Int -> m ()
2330

31+
-- | A typeclass providing utilities for /timeouts/.
2432
class (MonadDelay m, MonadSTM m) => MonadTimer m where
2533

34+
-- | See `STM.registerDelay`.
2635
registerDelay :: Int -> m (TVar m Bool)
2736

37+
-- | See `IO.timeout`.
2838
timeout :: Int -> m a -> m (Maybe a)
2939

3040
--

0 commit comments

Comments
 (0)