chatty-utils-0.7.3.2: Some utilities every serious chatty-based application may need.

Data.Chatty.Counter

Description

Provides a counter monad.

Synopsis

newtype CounterT m a Source

A counter monad.

Constructors

Fields

Instances

class Monad m => ChCounter m where Source

Typeclass for all counter monads.

Methods

countOn :: m Int Source

Tell the current number and increment it

withCounter :: (Monad m, Functor m) => CounterT m a -> m a Source

Run the given function inside a counter