| Safe Haskell | Safe-Inferred |
|---|
System.Timeout.Returning
- class Monad m => MonadTimeout w m | m -> w where
- data Timeout w a
- runTimeout :: Strategy w -> Int -> Timeout w () -> IO (Maybe w)
- returning :: MonadTimeout w m => m w -> m ()
Documentation
class Monad m => MonadTimeout w m | m -> w whereSource
Methods
Save an intermediate result of the computation.
tellWith :: (Maybe w -> w) -> m ()Source
Combine an intermediate result of the computation with the current saved result (if any) and save it.
Explicitly allow interrupting the computation at this point. Experimental.
Instances
| Monad (Timeout w) => MonadTimeout w (Timeout w) |
Arguments
| :: Strategy w | Evaluate values passed to |
| -> Int | Timeout in microseconds. |
| -> Timeout w () | The computation. |
| -> IO (Maybe w) | The result, or |
Execute the given computation with a timeout limit and force
the result to the form defined by the given Strategy.
returning :: MonadTimeout w m => m w -> m ()Source
Convert a monadic computation returning a value of the result type into
'm ()' so that it can be used with runTimeout. Calling 'returning k'
is equivalent to 'k >>= tell'.