polysemy-time-0.6.0.2: A Polysemy effect for time
Safe HaskellSafe-Inferred
LanguageGHC2021

Polysemy.Time.Loop

Description

Combinators for looping with a sleep interval, Internal

Synopsis

Documentation

untilJust :: forall t d u r a. Member (Time t d) r => TimeUnit u => u -> Sem r (Maybe a) -> Sem r a Source #

Repeatedly run the action, sleeping for interval between executions. Stops when action returns Just a, returning the contained a.

while :: forall t d u r. Member (Time t d) r => TimeUnit u => u -> Sem r Bool -> Sem r () Source #

Repeatedly run the action, sleeping for interval between executions. Stops when action returns False.

loop :: forall t d u a r. Member (Time t d) r => TimeUnit u => u -> a -> (a -> Sem r a) -> Sem r () Source #

Repeatedly run the action, sleeping for interval between executions. The result of action is passed back to it for the next run, starting with initial.

loop_ :: forall t d u r. Member (Time t d) r => TimeUnit u => u -> Sem r () -> Sem r () Source #

Repeatedly run the action, sleeping for interval between executions.