| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Workflow.Pure.Char
- int2keychord :: Integer -> [KeyChord]
- digit2keychord :: (MonadThrow m, Num a, Eq a, Show a) => a -> m KeyChord
- char2keychord :: MonadThrow m => Char -> m KeyChord
- keychord2char :: MonadThrow m => KeyChord -> m Char
Documentation
int2keychord :: Integer -> [KeyChord] Source #
>>>int2keychord -12[([],MinusKey),([],OneKey),([],TwoKey)]
digit2keychord :: (MonadThrow m, Num a, Eq a, Show a) => a -> m KeyChord Source #
a (base ten) digit is a number between zero and nine inclusive.
>>>digit2keychord 2([],TwoKey)
>>>digit2keychord -2Nothing
>>>digit2keychord 12Nothing
char2keychord :: MonadThrow m => Char -> m KeyChord Source #
the keychord that would insert the character into the application.
>>>char2keychord '@' :: Maybe KeyChordJust ([ShiftModifier], TwoKey)
some characters cannot be represented as keychordes, like some non-printable characters (in arbitrary applications, not just the terminal emulator):
>>>char2keychord '\0' :: Maybe KeyChordNothing
case char2keychord c of { Just ([],_) -> True; Just ([ShiftModifier],_) -> True; Nothing -> True; _ -> False }keychord2char :: MonadThrow m => KeyChord -> m Char Source #
the character that represents the keychord:
>>>keychord2char ([ShiftModifier], TwoKey) :: Maybe CharJust '@'
some keychordes cannot be represented as characters, like keyboard shortcuts:
>>>keychord2char ([Command], CKey) :: Maybe CharNothing
>>>import Data.Char>>>import Data.Maybeprop> maybe True isAscii (keychord2char k) TODO replace true with redo test