Safe Haskell  SafeInferred 

Language  Haskell2010 
 data Suspension s
 data Undoable s a = Undoable {
 getUndoable :: Suspension s > (Suspension s, a)
 runUndoable :: Undoable s a > s > (s, a)
 evalUndoable :: Undoable s a > s > a
 execUndoable :: Undoable s a > s > s
 suspend :: Undoable s (Suspension s)
 resume :: Suspension s > Undoable s ()
 event :: Undoable s a > Undoable s a
 undo :: Undoable s ()
Documentation
data Suspension s Source
Data representing the entire history of the state.
The undoable stateful computation monad.
Undoable  

MonadIO TimeMachine  
MonadState s (Undoable s)  
Monad (Undoable s)  
Functor (Undoable s)  
Applicative (Undoable s) 
runUndoable :: Undoable s a > s > (s, a) Source
Run an undoable computation and return both the resulting state and the result.
>>> runUndoable (do { modify (+3); return 5 }) 0 (3, 5)
evalUndoable :: Undoable s a > s > a Source
Run an undoable computation and return the result.
>>> evalUndoable (do { return 5 }) 0 5
execUndoable :: Undoable s a > s > s Source
Run an undoable computation and return the resulting state.
>>> execUndoable (do { modify (+3) }) 0 3
suspend :: Undoable s (Suspension s) Source
Save the history of a computation, to be later loaded with resume
.
resume :: Suspension s > Undoable s () Source
Load the history of a computation, saved by suspend
.