Safe Haskell | None |
---|---|

Language | Haskell98 |

- data Zipper a = Zipper {}
- data Step a = Step {}
- zipper :: StateTree a -> Zipper a
- handleKeyEvent :: KeyInfo -> a -> Zipper a -> (a, Zipper a)
- handleMouseEvent :: MouseInfo -> a -> Zipper a -> (a, Zipper a)
- goUp :: MousePos -> a -> Zipper a -> (a, Zipper a)
- goDown :: Int -> MousePos -> a -> Zipper a -> (a, Zipper a)
- replace :: State a -> Zipper a -> Zipper a
- transitionAppliesKI :: KeyInfo -> StateTransition -> Bool
- transitionAppliesMI :: MouseInfo -> StateTransition -> Bool

# Documentation

represents a step walking the state tree

handleKeyEvent :: KeyInfo -> a -> Zipper a -> (a, Zipper a) Source #

checks if a state transition should occur, otherwise calls the keyEvent function of the current state

handleMouseEvent :: MouseInfo -> a -> Zipper a -> (a, Zipper a) Source #

checks if a state transition should occur, otherwise calls the mouseEvent function of the current state

goUp :: MousePos -> a -> Zipper a -> (a, Zipper a) Source #

leave the current state and enter the parent state

goDown :: Int -> MousePos -> a -> Zipper a -> (a, Zipper a) Source #

leave the current state and enter the adjacent state
with index `adjIdx`

transitionAppliesKI :: KeyInfo -> StateTransition -> Bool Source #

checks if the KeyInfo matches the StateTransition

transitionAppliesMI :: MouseInfo -> StateTransition -> Bool Source #

checks of the MouseInfo matches the StateTransition