effect-monad-0.8.0.0: Embeds effect systems and program logics into Haskell using graded monads and parameterised monads
Control.Effect.CounterNat
Synopsis
data Counter (n :: Nat) a Source #
Provides a way to count in the type-level with a monadic interface to sum up the individual counts of subcomputations. Instead of using our own inductive natural number typ, this uses the Nat kind from TypeLits
count
Nat
TypeLits
The counter has no semantic meaning
Constructors
Fields
Instances
Associated Types
type Unit Counter (m :: Counter -> * -> *) :: k Source #
type Plus Counter (m :: Counter -> * -> *) (f :: Counter) (g :: Counter) :: k Source #
type Inv Counter (m :: Counter -> * -> *) (f :: Counter) (g :: Counter) :: Constraint Source #
Methods
return :: a -> m (Unit Counter m) a Source #
(>>=) :: Inv Counter m f g => m f a -> (a -> m g b) -> m (Plus Counter m f g) b Source #
(>>) :: Inv Counter m f g => m f a -> m g b -> m (Plus Counter m f g) b Source #
tick :: a -> Counter 1 a Source #
A tick provides a way to increment the counter
tick