disco-0.1.6: Functional programming language for teaching discrete math.
Copyrightdisco team and contributors
LicenseBSD-3-Clause
Maintainerbyorgey@gmail.com
Safe HaskellSafe-Inferred
LanguageHaskell2010

Disco.Effects.Counter

Description

Polysemy effect for integer counter.

Synopsis

Documentation

data Counter m a where Source #

Constructors

Next :: Counter m Integer

Return the next integer in sequence.

next :: forall r. Member Counter r => Sem r Integer Source #

Return the next integer in sequence.

runCounter' :: Integer -> Sem (Counter ': r) a -> Sem r a Source #

Dispatch a counter effect, starting the counter from the given Integer.

runCounter :: Sem (Counter ': r) a -> Sem r a Source #

Dispatch a counter effect, starting the counter from zero.