data-effects-0.2.0.0: A basic framework for effect systems based on effects represented by GADTs.
Copyright(c) 2024 Sayo Koyoneda
LicenseMPL-2.0 (see the file LICENSE)
Maintainerymdfield@outlook.jp
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageGHC2021

Data.Effect.Concurrent.Timer

Description

 

Documentation

data Timer a where Source #

Constructors

Clock :: Timer DiffTime 
Sleep :: DiffTime -> Timer () 

pattern LSleep :: forall a f. () => (a ~ (), ()) => DiffTime -> LiftFOE Timer f a Source #

pattern LClock :: forall a f. () => (a ~ DiffTime, ()) => LiftFOE Timer f a Source #

clock' :: forall {k} (tag :: k) f. SendFOE (Tag Timer tag) f => f DiffTime Source #

clock'' :: forall {k} (key :: k) f. SendFOEBy key Timer f => f DiffTime Source #

sleep' :: forall {k} (tag :: k) f. SendFOE (Tag Timer tag) f => DiffTime -> f () Source #

sleep'' :: forall {k} (key :: k) f. SendFOEBy key Timer f => DiffTime -> f () Source #

withElapsedTime :: (Timer <: m, Monad m) => (m DiffTime -> m a) -> m a Source #

measureTime :: (Timer <: m, Monad m) => m a -> m (DiffTime, a) Source #

runCyclic :: (Timer <: m, Monad m) => m DiffTime -> m () -> m a Source #

runPeriodic :: (Timer <: m, Monad m) => DiffTime -> m () -> m a Source #

periodicTimer :: (Timer <: m, Yield () () <: m, Monad m) => DiffTime -> m a Source #

cyclicTimer :: (Timer <: m, Yield () DiffTime <: m, Monad m) => m a Source #

data CyclicTimer a where Source #

Constructors

Wait :: DiffTime -> CyclicTimer () 

pattern LWait :: forall a f. () => (a ~ (), ()) => DiffTime -> LiftFOE CyclicTimer f a Source #

wait' :: forall {k} (tag :: k) f. SendFOE (Tag CyclicTimer tag) f => DiffTime -> f () Source #

wait'' :: forall {k} (key :: k) f. SendFOEBy key CyclicTimer f => DiffTime -> f () Source #