Copyright | (C) 2020 Peter Lu |
---|---|
License | see the file LICENSE |
Maintainer | pdlla <chippermonky@gmail.com> |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
A dynamic structure intended for modelling action stacks for undo/redo. Internally, it is represented as two stacks: "done" and "undone". Redo/undo moves the top element from one stack to another. New do events add elements to the "done" stack and clears the "undone" stack.
Synopsis
- data ActionStack t a = ActionStack {
- _actionStack_do :: Event t a
- _actionStack_undo :: Event t a
- actionStack_makeDoSelector :: (GCompare k, Reflex t) => ActionStack t (DSum k Identity) -> k a -> Event t a
- actionStack_makeUndoSelector :: (GCompare k, Reflex t) => ActionStack t (DSum k Identity) -> k a -> Event t a
- data ActionStackConfig t a = ActionStackConfig {
- _actionStackConfig_do :: Event t a
- _actionStackConfig_undo :: Event t ()
- _actionStackConfig_redo :: Event t ()
- _actionStackConfig_clear :: Event t ()
- holdActionStack :: forall t m a. (Reflex t, MonadHold t m, MonadFix m) => ActionStackConfig t a -> m (ActionStack t a)
Documentation
data ActionStack t a Source #
ActionStack | |
|
actionStack_makeDoSelector :: (GCompare k, Reflex t) => ActionStack t (DSum k Identity) -> k a -> Event t a Source #
helper method for ActionStacks that use DSum to represent actions
actionStack_makeUndoSelector :: (GCompare k, Reflex t) => ActionStack t (DSum k Identity) -> k a -> Event t a Source #
helper method for ActionStacks that use DSum to represent actions
data ActionStackConfig t a Source #
ActionStackConfig | |
|
holdActionStack :: forall t m a. (Reflex t, MonadHold t m, MonadFix m) => ActionStackConfig t a -> m (ActionStack t a) Source #