yi-0.10.1: The Haskell-Scriptable Editor

LicenseGPL-2
Maintaineryi-devel@googlegroups.com
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010
Extensions
  • TemplateHaskell
  • StandaloneDeriving
  • DeriveDataTypeable
  • TypeSynonymInstances
  • FlexibleContexts
  • FlexibleInstances
  • MultiParamTypeClasses
  • FunctionalDependencies
  • ExistentialQuantification
  • GeneralizedNewtypeDeriving
  • RankNTypes
  • ExplicitForAll
  • NondecreasingIndentation

Yi.Keymap

Contents

Description

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) 

type Interact ev a = I ev Action a Source

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
 

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

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

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

catchJustE Source

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 a Source

class YiAction a x | a -> x where Source

Methods

makeAction :: Show x => a -> Action Source

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

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