Safe Haskell | None |
---|
Hbro.Keys
Description
Key bindings model.
Designed to be imported as qualified
.
- data Tree edge leaf
- type Stroke = (Set Modifier, String)
- type Bindings m = Tree Stroke (m ())
- data Mode
- data Status = Status {}
- mode :: Lens' Status Mode
- strokes :: Lens' Status [Stroke]
- class StatusReader m where
- readStatus :: Simple Lens Status a -> m a
- class StatusWriter m where
- writeStatus :: Simple Lens Status a -> a -> m ()
- type StatusState m = (StatusReader m, StatusWriter m)
- mkStroke :: [Modifier] -> KeyVal -> Maybe Stroke
- merge :: Ord a => Tree a b -> Tree a b -> Tree a b
- lookup :: Ord a => [a] -> Tree a b -> Maybe (Tree a b)
- deserialize :: String -> Maybe [Stroke]
- prefixMod :: Modifier -> [Stroke] -> Maybe [Stroke]
- serialize :: Stroke -> String
- toString :: KeyVal -> Maybe String
- mkBinding :: String -> m () -> Maybe (Bindings m)
- toBindings :: [(String, m ())] -> Bindings m
Documentation
A tree implementation that labels edges
type Stroke = (Set Modifier, String)Source
A single keystroke, i.e. a set of modifiers and a single key (its string description)
Global state
class StatusReader m whereSource
MonadReader
for Status
Methods
readStatus :: Simple Lens Status a -> m aSource
Instances
class StatusWriter m whereSource
MonadWriter
for Status
Methods
writeStatus :: Simple Lens Status a -> a -> m ()Source
Instances
type StatusState m = (StatusReader m, StatusWriter m)Source
MonadState
for Status
merge :: Ord a => Tree a b -> Tree a b -> Tree a bSource
In case of conflicts, the rightmost operand is preferred
toBindings :: [(String, m ())] -> Bindings mSource