atrans-0.1.0.1: A small collection of monad (transformer) instances.

Copyright(c) Philipp Pfeiffer, 2016
LicenseMIT
Maintainerpfiff@hax-f.net
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe
LanguageHaskell2010

Control.Monad.Backend

Description

Defines the BackendT transformer, which is a variant of the StateT transformer, such that the state is within an MVar.

Synopsis

Documentation

newtype BackendT s m a Source

The BackendT transformer is a StateT, where the state is encapsulated into a MVar. The initialized MVar has to be non empty, otherwise every state change is blocking.

Constructors

BackendT (MVar s -> m (MVar s, a)) 

Instances

runBackendT :: BackendT s m a -> MVar s -> m (MVar s, a) Source

runBackendT unwraps the BackendT monad.