objective-0.6.5.1: Extensible objects

Safe HaskellNone
LanguageHaskell2010

Control.Object.Extra

Synopsis

Documentation

oneshot :: (Functor f, Monad m) => (forall a. f (m a) -> m a) -> Object f m Source

Build an object using continuation passing style.

flyweight :: (Monad m, Ord k) => (k -> m a) -> Object (Request k a) m Source

The flyweight pattern.

flyweight' :: (Monad m, Eq k, Hashable k) => (k -> m a) -> Object (Request k a) m Source

Like flyweight, but it uses Strict internally.

animate :: (Applicative m, Num t) => (t -> m a) -> Object (Request t a) m Source

transit :: (Alternative m, Fractional t, Ord t) => t -> (t -> m a) -> Object (Request t a) m Source

announce :: (Traversable t, Monad m) => f a -> StateT (t (Object f m)) m [a] Source

announceMaybe :: (Witherable t, Monad m) => f a -> StateT (t (Object f Maybe)) m [a] Source

announceMaybeT :: (Witherable t, Monad m) => f a -> StateT (t (Object f (MaybeT m))) m [a] Source

type Variable s = forall m. Monad m => Object (StateT s m) m Source

variable :: s -> Variable s Source

A mutable variable.

moore :: Applicative f => (a -> r -> f r) -> r -> Object (PushPull a r) f Source

foldPP :: Applicative f => (a -> r -> r) -> r -> Object (PushPull a r) f Source

(*-) :: MonadIO m => IORef (Object f m) -> f a -> m a Source

invokeState :: f a -> StateT (Object f m) m a Source