yi-core-0.14.0: Yi editor core library

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

Yi.Keymap

Contents

Description

Synopsis

Documentation

data Action #

Constructors

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

Instances

type Interact ev a = I ev Action a #

type KeymapM a = Interact Event a #

type Keymap = KeymapM () #

data KeymapSet #

Constructors

KeymapSet 

Fields

newtype YiM a #

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

Constructors

YiM 

Fields

Instances

Monad YiM # 

Methods

(>>=) :: YiM a -> (a -> YiM b) -> YiM b #

(>>) :: YiM a -> YiM b -> YiM b #

return :: a -> YiM a #

fail :: String -> YiM a #

Functor YiM # 

Methods

fmap :: (a -> b) -> YiM a -> YiM b #

(<$) :: a -> YiM b -> YiM a #

Applicative YiM # 

Methods

pure :: a -> YiM a #

(<*>) :: YiM (a -> b) -> YiM a -> YiM b #

(*>) :: YiM a -> YiM b -> YiM b #

(<*) :: YiM a -> YiM b -> YiM a #

MonadEditor YiM # 

Methods

askCfg :: YiM Config #

withEditor :: EditorM a -> YiM a #

withEditor_ :: EditorM a -> YiM () #

MonadReader Yi YiM # 

Methods

ask :: YiM Yi #

local :: (Yi -> Yi) -> YiM a -> YiM a #

reader :: (Yi -> a) -> YiM a #

MonadState Editor YiM # 

Methods

get :: YiM Editor #

put :: Editor -> YiM () #

state :: (Editor -> (a, Editor)) -> YiM a #

MonadBase IO YiM # 

Methods

liftBase :: IO α -> YiM α #

HookType (YiM a) # 

Methods

runHookImpl :: YiConfigVariable var => (var -> YiM a) -> YiM a

YiAction (YiM x) x # 

Methods

makeAction :: YiM x -> Action #

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

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

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

catchJustE #

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 #

class YiAction a x | a -> x where #

Minimal complete definition

makeAction

Methods

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

Instances

YiAction Action () # 

Methods

makeAction :: Action -> Action #

YiAction (IO x) x # 

Methods

makeAction :: IO x -> Action #

YiAction (EditorM x) x # 

Methods

makeAction :: EditorM x -> Action #

YiAction (BufferM x) x # 

Methods

makeAction :: BufferM x -> Action #

YiAction (YiM x) x # 

Methods

makeAction :: YiM x -> Action #

data Yi #

Constructors

Yi 

Fields

Instances

MonadReader Yi YiM # 

Methods

ask :: YiM Yi #

local :: (Yi -> Yi) -> YiM a -> YiM a #

reader :: (Yi -> a) -> YiM a #

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

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

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

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 ()) #