reflex-0.6.4: Higher-order Functional Reactive Programming

Safe HaskellNone
LanguageHaskell2010

Reflex.Adjustable.Class

Contents

Description

 
Synopsis

The Adjustable typeclass

class (Reflex t, Monad m) => Adjustable t m | m -> t where Source #

A Monad that supports adjustment over time. After an action has been run, if the given events fire, it will adjust itself so that its net effect is as though it had originally been run with the new value. Note that there is some issue here with persistent side-effects: obviously, IO (and some other side-effects) cannot be undone, so it is up to the instance implementer to determine what the best meaning for this class is in such cases.

Methods

runWithReplace :: m a -> Event t (m b) -> m (a, Event t b) Source #

traverseIntMapWithKeyWithAdjust :: (Key -> v -> m v') -> IntMap v -> Event t (PatchIntMap v) -> m (IntMap v', Event t (PatchIntMap v')) Source #

traverseDMapWithKeyWithAdjust :: GCompare k => (forall a. k a -> v a -> m (v' a)) -> DMap k v -> Event t (PatchDMap k v) -> m (DMap k v', Event t (PatchDMap k v')) Source #

traverseDMapWithKeyWithAdjustWithMove :: GCompare k => (forall a. k a -> v a -> m (v' a)) -> DMap k v -> Event t (PatchDMapWithMove k v) -> m (DMap k v', Event t (PatchDMapWithMove k v')) Source #

Instances
Adjustable t m => Adjustable t (ReaderT r m) Source # 
Instance details

Defined in Reflex.Adjustable.Class

Methods

runWithReplace :: ReaderT r m a -> Event t (ReaderT r m b) -> ReaderT r m (a, Event t b) Source #

traverseIntMapWithKeyWithAdjust :: (Key -> v -> ReaderT r m v') -> IntMap v -> Event t (PatchIntMap v) -> ReaderT r m (IntMap v', Event t (PatchIntMap v')) Source #

traverseDMapWithKeyWithAdjust :: GCompare k => (forall a. k a -> v a -> ReaderT r m (v' a)) -> DMap k v -> Event t (PatchDMap k v) -> ReaderT r m (DMap k v', Event t (PatchDMap k v')) Source #

traverseDMapWithKeyWithAdjustWithMove :: GCompare k => (forall a. k a -> v a -> ReaderT r m (v' a)) -> DMap k v -> Event t (PatchDMapWithMove k v) -> ReaderT r m (DMap k v', Event t (PatchDMapWithMove k v')) Source #

Adjustable t m => Adjustable t (TriggerEventT t m) Source # 
Instance details

Defined in Reflex.TriggerEvent.Base

Methods

runWithReplace :: TriggerEventT t m a -> Event t (TriggerEventT t m b) -> TriggerEventT t m (a, Event t b) Source #

traverseIntMapWithKeyWithAdjust :: (Key -> v -> TriggerEventT t m v') -> IntMap v -> Event t (PatchIntMap v) -> TriggerEventT t m (IntMap v', Event t (PatchIntMap v')) Source #

traverseDMapWithKeyWithAdjust :: GCompare k => (forall a. k a -> v a -> TriggerEventT t m (v' a)) -> DMap k v -> Event t (PatchDMap k v) -> TriggerEventT t m (DMap k v', Event t (PatchDMap k v')) Source #

traverseDMapWithKeyWithAdjustWithMove :: GCompare k => (forall a. k a -> v a -> TriggerEventT t m (v' a)) -> DMap k v -> Event t (PatchDMapWithMove k v) -> TriggerEventT t m (DMap k v', Event t (PatchDMapWithMove k v')) Source #

(Reflex t, MonadHold t m, MonadFix m, Adjustable t m, PerformEvent t m) => Adjustable t (PostBuildT t m) Source # 
Instance details

Defined in Reflex.PostBuild.Base

Methods

runWithReplace :: PostBuildT t m a -> Event t (PostBuildT t m b) -> PostBuildT t m (a, Event t b) Source #

traverseIntMapWithKeyWithAdjust :: (Key -> v -> PostBuildT t m v') -> IntMap v -> Event t (PatchIntMap v) -> PostBuildT t m (IntMap v', Event t (PatchIntMap v')) Source #

traverseDMapWithKeyWithAdjust :: GCompare k => (forall a. k a -> v a -> PostBuildT t m (v' a)) -> DMap k v -> Event t (PatchDMap k v) -> PostBuildT t m (DMap k v', Event t (PatchDMap k v')) Source #

traverseDMapWithKeyWithAdjustWithMove :: GCompare k => (forall a. k a -> v a -> PostBuildT t m (v' a)) -> DMap k v -> Event t (PatchDMapWithMove k v) -> PostBuildT t m (DMap k v', Event t (PatchDMapWithMove k v')) Source #

(ReflexHost t, PrimMonad (HostFrame t)) => Adjustable t (PerformEventT t m) Source # 
Instance details

Defined in Reflex.PerformEvent.Base

Methods

runWithReplace :: PerformEventT t m a -> Event t (PerformEventT t m b) -> PerformEventT t m (a, Event t b) Source #

traverseIntMapWithKeyWithAdjust :: (Key -> v -> PerformEventT t m v') -> IntMap v -> Event t (PatchIntMap v) -> PerformEventT t m (IntMap v', Event t (PatchIntMap v')) Source #

traverseDMapWithKeyWithAdjust :: GCompare k => (forall a. k a -> v a -> PerformEventT t m (v' a)) -> DMap k v -> Event t (PatchDMap k v) -> PerformEventT t m (DMap k v', Event t (PatchDMap k v')) Source #

traverseDMapWithKeyWithAdjustWithMove :: GCompare k => (forall a. k a -> v a -> PerformEventT t m (v' a)) -> DMap k v -> Event t (PatchDMapWithMove k v) -> PerformEventT t m (DMap k v', Event t (PatchDMapWithMove k v')) Source #

(Reflex t, Adjustable t m, MonadHold t m, Semigroup w) => Adjustable t (EventWriterT t w m) Source # 
Instance details

Defined in Reflex.EventWriter.Base

Methods

runWithReplace :: EventWriterT t w m a -> Event t (EventWriterT t w m b) -> EventWriterT t w m (a, Event t b) Source #

traverseIntMapWithKeyWithAdjust :: (Key -> v -> EventWriterT t w m v') -> IntMap v -> Event t (PatchIntMap v) -> EventWriterT t w m (IntMap v', Event t (PatchIntMap v')) Source #

traverseDMapWithKeyWithAdjust :: GCompare k => (forall a. k a -> v a -> EventWriterT t w m (v' a)) -> DMap k v -> Event t (PatchDMap k v) -> EventWriterT t w m (DMap k v', Event t (PatchDMap k v')) Source #

traverseDMapWithKeyWithAdjustWithMove :: GCompare k => (forall a. k a -> v a -> EventWriterT t w m (v' a)) -> DMap k v -> Event t (PatchDMapWithMove k v) -> EventWriterT t w m (DMap k v', Event t (PatchDMapWithMove k v')) Source #

(Reflex t, MonadFix m, Group q, Additive q, Query q, Eq q, MonadHold t m, Adjustable t m) => Adjustable t (QueryT t q m) Source # 
Instance details

Defined in Reflex.Query.Base

Methods

runWithReplace :: QueryT t q m a -> Event t (QueryT t q m b) -> QueryT t q m (a, Event t b) Source #

traverseIntMapWithKeyWithAdjust :: (Key -> v -> QueryT t q m v') -> IntMap v -> Event t (PatchIntMap v) -> QueryT t q m (IntMap v', Event t (PatchIntMap v')) Source #

traverseDMapWithKeyWithAdjust :: GCompare k => (forall a. k a -> v a -> QueryT t q m (v' a)) -> DMap k v -> Event t (PatchDMap k v) -> QueryT t q m (DMap k v', Event t (PatchDMap k v')) Source #

traverseDMapWithKeyWithAdjustWithMove :: GCompare k => (forall a. k a -> v a -> QueryT t q m (v' a)) -> DMap k v -> Event t (PatchDMapWithMove k v) -> QueryT t q m (DMap k v', Event t (PatchDMapWithMove k v')) Source #

(Adjustable t m, MonadFix m, Monoid w, MonadHold t m, Reflex t) => Adjustable t (DynamicWriterT t w m) Source #

When the execution of a DynamicWriterT action is adjusted using Adjustable, the Dynamic output of that action will also be updated to match.

Instance details

Defined in Reflex.DynamicWriter.Base

Methods

runWithReplace :: DynamicWriterT t w m a -> Event t (DynamicWriterT t w m b) -> DynamicWriterT t w m (a, Event t b) Source #

traverseIntMapWithKeyWithAdjust :: (Key -> v -> DynamicWriterT t w m v') -> IntMap v -> Event t (PatchIntMap v) -> DynamicWriterT t w m (IntMap v', Event t (PatchIntMap v')) Source #

traverseDMapWithKeyWithAdjust :: GCompare k => (forall a. k a -> v a -> DynamicWriterT t w m (v' a)) -> DMap k v -> Event t (PatchDMap k v) -> DynamicWriterT t w m (DMap k v', Event t (PatchDMap k v')) Source #

traverseDMapWithKeyWithAdjustWithMove :: GCompare k => (forall a. k a -> v a -> DynamicWriterT t w m (v' a)) -> DMap k v -> Event t (PatchDMapWithMove k v) -> DynamicWriterT t w m (DMap k v', Event t (PatchDMapWithMove k v')) Source #

(Adjustable t m, Monoid w, MonadHold t m, Reflex t) => Adjustable t (BehaviorWriterT t w m) Source # 
Instance details

Defined in Reflex.BehaviorWriter.Base

Methods

runWithReplace :: BehaviorWriterT t w m a -> Event t (BehaviorWriterT t w m b) -> BehaviorWriterT t w m (a, Event t b) Source #

traverseIntMapWithKeyWithAdjust :: (Key -> v -> BehaviorWriterT t w m v') -> IntMap v -> Event t (PatchIntMap v) -> BehaviorWriterT t w m (IntMap v', Event t (PatchIntMap v')) Source #

traverseDMapWithKeyWithAdjust :: GCompare k => (forall a. k a -> v a -> BehaviorWriterT t w m (v' a)) -> DMap k v -> Event t (PatchDMap k v) -> BehaviorWriterT t w m (DMap k v', Event t (PatchDMap k v')) Source #

traverseDMapWithKeyWithAdjustWithMove :: GCompare k => (forall a. k a -> v a -> BehaviorWriterT t w m (v' a)) -> DMap k v -> Event t (PatchDMapWithMove k v) -> BehaviorWriterT t w m (DMap k v', Event t (PatchDMapWithMove k v')) Source #

(Reflex t, Adjustable t m, MonadHold t m, MonadFix m) => Adjustable t (RequesterT t request response m) Source # 
Instance details

Defined in Reflex.Requester.Base

Methods

runWithReplace :: RequesterT t request response m a -> Event t (RequesterT t request response m b) -> RequesterT t request response m (a, Event t b) Source #

traverseIntMapWithKeyWithAdjust :: (Key -> v -> RequesterT t request response m v') -> IntMap v -> Event t (PatchIntMap v) -> RequesterT t request response m (IntMap v', Event t (PatchIntMap v')) Source #

traverseDMapWithKeyWithAdjust :: GCompare k => (forall a. k a -> v a -> RequesterT t request response m (v' a)) -> DMap k v -> Event t (PatchDMap k v) -> RequesterT t request response m (DMap k v', Event t (PatchDMap k v')) Source #

traverseDMapWithKeyWithAdjustWithMove :: GCompare k => (forall a. k a -> v a -> RequesterT t request response m (v' a)) -> DMap k v -> Event t (PatchDMapWithMove k v) -> RequesterT t request response m (DMap k v', Event t (PatchDMapWithMove k v')) Source #

sequenceDMapWithAdjust :: (GCompare k, Adjustable t m) => DMap k m -> Event t (PatchDMap k m) -> m (DMap k Identity, Event t (PatchDMap k Identity)) Source #

Traverse a DMap of Adjustable actions, running each of them. The provided Event of patches to the DMap can add, remove, or update values.

sequenceDMapWithAdjustWithMove :: (GCompare k, Adjustable t m) => DMap k m -> Event t (PatchDMapWithMove k m) -> m (DMap k Identity, Event t (PatchDMapWithMove k Identity)) Source #

Traverses a DMap of Adjustable actions, running each of them. The provided Event of patches to the DMap can add, remove, update, move, or swap values.

mapMapWithAdjustWithMove :: forall t m k v v'. (Adjustable t m, Ord k) => (k -> v -> m v') -> Map k v -> Event t (PatchMapWithMove k v) -> m (Map k v', Event t (PatchMapWithMove k v')) Source #

Traverses a Map, running the provided Adjustable action. The provided Event of patches to the Map can add, remove, update, move, or swap values.

Deprecated aliases

type MonadAdjust = Adjustable Source #

Deprecated: Use Adjustable instead

Synonym for Adjustable