effect-monad-0.6.1: Embeds effect systems into Haskell using parameteric effect monads

Safe HaskellNone
LanguageHaskell98

Control.Effect.CounterNat

Synopsis

Documentation

data Counter n 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

The counter has no semantic meaning

Constructors

Counter 

Fields

forget :: a
 

Instances

Effect Nat Counter 
type Unit Nat Counter = 0 
type Plus Nat Counter n m = (+) n m 
type Inv Nat Counter n m = () 

tick :: a -> Counter 1 a Source

A tick provides a way to increment the counter