Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class (Reflex t, Monad m) => Adjustable t m | m -> t where
- runWithReplace :: m a -> Event t (m b) -> m (a, Event t b)
- traverseIntMapWithKeyWithAdjust :: (Key -> v -> m v') -> IntMap v -> Event t (PatchIntMap v) -> m (IntMap v', Event t (PatchIntMap v'))
- 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'))
- 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'))
- sequenceDMapWithAdjust :: (GCompare k, Adjustable t m) => DMap k m -> Event t (PatchDMap k m) -> m (DMap k Identity, Event t (PatchDMap k Identity))
- sequenceDMapWithAdjustWithMove :: (GCompare k, Adjustable t m) => DMap k m -> Event t (PatchDMapWithMove k m) -> m (DMap k Identity, Event t (PatchDMapWithMove k Identity))
- 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'))
- type MonadAdjust = Adjustable
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.
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
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