monad-atom-0.3.0: Monadically convert objects to unique atoms and back.

Safe HaskellNone

Control.Monad.Atom

Synopsis

Documentation

class Monad m => MonadAtom m whereSource

Methods

toAtom :: Serialize a => a -> m IntSource

Monadically convert the argument into an atom (represented as an Int)

maybeToAtom :: Serialize a => a -> m (Maybe Int)Source

Monadically convert the argument into an atom, but only if the corresponding atom has already been created

fromAtom :: Serialize a => Int -> m aSource

Monadically convert an atom represented as an Int to its corresponding object

Instances

data AtomT m r Source

Instances

evalAtomT :: Monad m => AtomT m a -> m aSource

runAtomT :: AtomT t t1 -> AtomTable -> t (t1, AtomTable)Source

atoms :: AtomTable -> [Int]Source

The list of atoms (as Ints) stored in the atom table