Safe Haskell | None |
---|---|
Language | Haskell98 |
Key bindings model.
Designed to be imported as qualified
.
- data KeyStroke modifier key = KeyStroke modifier key
- (.|) :: Monoid modifier => modifier -> key -> KeyStroke modifier key
- singleKey :: Monoid m => k -> KeyStroke m k
- type Binding keystroke action = (NonEmpty keystroke, action)
- type KeyMap keystroke action = Map (NonEmpty keystroke) action
- type ModalBindings mode keystroke action = Map mode (KeyMap keystroke action)
Key strokes model
data KeyStroke modifier key
A single keystroke is a modifier, and a single key.
modifier is usually a Monoid
.
KeyStroke modifier key |
KeyMap model
type Binding keystroke action = (NonEmpty keystroke, action)
A binding is simply a (non-empty) list of strokes bound to an action
type KeyMap keystroke action = Map (NonEmpty keystroke) action
A non-empty tree implementation that labels edges and leaves type BranchedTree b l = [(b, Tree b l)] data Tree b l = Leaf l | Branch (NonEmpty (b, Tree b l))
KeyMap are stored together in a tree structure type KeyMap keystroke action = BranchedTree keystroke action
type ModalBindings mode keystroke action = Map mode (KeyMap keystroke action)
Modal bindings (à la vi)