Copyright | (c) Fumiaki Kinoshita 2015 |
---|---|
License | BSD3 |
Maintainer | Fumiaki Kinoshita <[email protected]> |
Stability | provisional |
Portability | GADTs, Rank2Types |
Safe Haskell | Safe |
Language | Haskell2010 |
Control.Object.Instance
Contents
Description
- data Instance f g where
- new :: MonadIO m => Object f g -> m (Instance f g)
- newSettle :: MonadIO m => Object f m -> m (Instance f m)
- newSTM :: MonadSTM m => Object f g -> m (Instance f g)
- invokeOn :: (MonadIO m, MonadMask m) => (forall x. g x -> m x) -> Instance f g -> f a -> m a
- invokeOnSTM :: (forall x. g x -> STM x) -> Instance f g -> f a -> STM a
- (.-) :: (MonadIO m, MonadMask m) => Instance f m -> f a -> m a
- (..-) :: MonadSTM m => Instance f STM -> f a -> m a
- snapshot :: (MonadSTM m, Functor g) => Instance f g -> m (Object f g)
Instantiation
data Instance f g where Source
TMVar-based instance
Constructors
InstRef :: (forall x. e x -> f x) -> (forall x. g x -> h x) -> TMVar (Object f g) -> Instance e h |
Instances
new :: MonadIO m => Object f g -> m (Instance f g) Source
Create a new instance. This can be used inside unsafePerformIO
to create top-level instances.
newSettle :: MonadIO m => Object f m -> m (Instance f m) Source
Create a new instance, having it sitting on the current environment.
Invocation
invokeOn :: (MonadIO m, MonadMask m) => (forall x. g x -> m x) -> Instance f g -> f a -> m a Source
Invoke a method with an explicit landing function.
invokeOnSTM :: (forall x. g x -> STM x) -> Instance f g -> f a -> STM a Source
Invoke a method with an explicit landing function.