yi-0.11.0: The Haskell-Scriptable Editor

Portabilityportable
Stabilityexperimental
Maintaineryi-devel@googlegroups.com
Safe HaskellNone

Yi.Keymap

Contents

Description

Keymap, YiM and Actions.

Synopsis

Documentation

data Action Source

Constructors

forall a . Show a => YiA (YiM a) 
forall a . Show a => EditorA (EditorM a) 
forall a . Show a => BufferA (BufferM a) 

Instances

Eq Action 
Show Action 
Typeable Action 
YiAction Action () 

type Interact ev a = I ev Action aSource

data KeymapSet Source

Constructors

KeymapSet 

Fields

topKeymap :: Keymap

Content of the top-level loop.

insertKeymap :: Keymap

For insertion-only modes

newtype YiM a Source

The type of user-bindable functions TODO: doc how these are actually user-bindable are they?

Constructors

YiM 

Fields

runYiM :: ReaderT Yi IO a
 

Instances

Monad YiM 
Functor YiM 
Typeable1 YiM 
Applicative YiM 
MonadEditor YiM 
MonadReader Yi YiM 
MonadState Editor YiM 
MonadBase IO YiM 
HookType (YiM a) 
YiAction (YiM x) x 

withUI :: (UI Editor -> IO a) -> YiM aSource

unsafeWithEditor :: Config -> MVar YiVar -> EditorM a -> IO aSource

readEditor :: MonadEditor m => (Editor -> a) -> m aSource

catchDynE :: Exception exception => YiM a -> (exception -> YiM a) -> YiM aSource

catchJustESource

Arguments

:: Exception e 
=> (e -> Maybe b)

Predicate to select exceptions

-> YiM a

Computation to run

-> (b -> YiM a)

Handler

-> YiM a 

handleJustE :: Exception e => (e -> Maybe b) -> (b -> YiM a) -> YiM a -> YiM aSource

class YiAction a x | a -> x whereSource

Methods

makeAction :: Show x => a -> ActionSource

Instances

YiAction Action () 
YiAction (IO x) x 
YiAction (EditorM x) x 
YiAction (BufferM x) x 
YiAction (YiM x) x 
(YiAction a x, Promptable r) => YiAction (r -> a) x 

data Yi Source

Constructors

Yi 

Fields

yiUi :: UI Editor
 
yiInput :: [Event] -> IO ()

input stream

yiOutput :: IsRefreshNeeded -> [Action] -> IO ()

output stream

yiConfig :: Config
 
yiVar :: MVar YiVar

The only mutable state in the program

Instances

Typeable Yi 
MonadReader Yi YiM 

write :: (MonadInteract m Action ev, YiAction a x, Show x) => a -> m ()Source

write a returns a keymap that just outputs the action a.

withModeY :: (forall syntax. Mode syntax -> YiM ()) -> YiM ()Source

withModeY f runs f on the current buffer's mode. As this runs in the YiM monad, we're able to do more than with just withModeB such as prompt the user for something before running the action.

Lenses

yiInputA :: Lens' Yi ([Event] -> IO ())Source