java-bridge-extras-0.9: Utilities for working with the java-bridge package.

Safe HaskellSafe-Inferred

Foreign.Java.Control

Description

Utilities for controlling actions inside the Java monad.

Synopsis

Documentation

when :: Monad m => m Bool -> m () -> m ()Source

Execute an action if the given predicate evaluates to True.

unless :: Monad m => m Bool -> m () -> m ()Source

Execute an action if the given predicate evaluates to False.

whether :: Monad m => m Bool -> m a -> m a -> m aSource

Execute either the first or the second action, depending on whether the given predicate evaluates to True or False.

while :: Monad m => m Bool -> m () -> m ()Source

Run a computation as long as the given predicate evaluates to True.

for :: Monad m => a -> (a -> m Bool) -> (a -> m a) -> m aSource

Reiterate a computation on a given value as long as a condition is True.

until :: Monad m => a -> (a -> m (Bool, a)) -> m aSource

Reiterate a computation on a given value until a condition is True.