Safe Haskell | None |
---|---|
Language | Haskell2010 |
Abstraction over the primitive and pure versions of StateBagT.
- class Monad m => StateBagMonad m where
- class ElementCount a
- class ElementIndex x xs
Documentation
class Monad m => StateBagMonad m where Source #
Type-class which abstract over the primitive and pure versions of StateBagT.
getItem :: ElementIndex item (Bag m) => m item Source #
Gets the current value of item
from the bag.
putItem :: ElementIndex item (Bag m) => item -> m () Source #
Stores a new value of item
in the bag.
modifyItemM :: ElementIndex item (Bag m) => (item -> m item) -> m () Source #
Applies a monadic function to an item in the bag and stores the result.
Monad m => StateBagMonad (StateBagT bag m) Source # | |
PrimMonad m => StateBagMonad (StateBagT bag m) Source # | |
class ElementCount a Source #
Type-class for counting the number of elements in a type-level list.
elemCount
ElementCount ([] *) Source # | |
ElementCount xs => ElementCount ((:) * x xs) Source # | |
class ElementIndex x xs Source #
Type-class for finding the index of an element in a type-level list.
elemIndex
ElementIndex x xs => ElementIndex x ((:) * y xs) Source # | |
ElementIndex x ((:) * x xs) Source # | |