yi-core-0.14.0: Yi editor core library

LicenseGPL-2
Maintaineryi-devel@googlegroups.com
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010
Extensions
  • Cpp
  • ScopedTypeVariables
  • DeriveDataTypeable
  • DeriveFunctor
  • DeriveTraversable
  • DeriveFoldable
  • FlexibleContexts
  • ConstrainedClassMethods
  • MultiParamTypeClasses
  • ExistentialQuantification
  • GeneralizedNewtypeDeriving
  • ExplicitForAll
  • LambdaCase

Yi.Types

Description

This module is the host of the most prevalent types throughout Yi. It is unfortunately a necessary evil to avoid use of bootfiles.

You're encouraged to import from more idiomatic modules which will re-export these where appropriate.

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 Yi #

Constructors

Yi 

Fields

Instances

MonadReader Yi YiM # 

Methods

ask :: YiM Yi #

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

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

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 #

data KeymapSet #

Constructors

KeymapSet 

Fields

newtype BufferM a #

The BufferM monad writes the updates performed.

Constructors

BufferM 

Instances

Monad BufferM # 

Methods

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

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

return :: a -> BufferM a #

fail :: String -> BufferM a #

Functor BufferM # 

Methods

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

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

Applicative BufferM # 

Methods

pure :: a -> BufferM a #

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

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

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

MonadReader Window BufferM # 

Methods

ask :: BufferM Window #

local :: (Window -> Window) -> BufferM a -> BufferM a #

reader :: (Window -> a) -> BufferM a #

MonadState FBuffer BufferM # 

Methods

get :: BufferM FBuffer #

put :: FBuffer -> BufferM () #

state :: (FBuffer -> (a, FBuffer)) -> BufferM a #

YiAction (BufferM x) x # 

Methods

makeAction :: BufferM x -> Action #

data IndentSettings #

Currently duplicates some of Vim's indent settings. Allowing a buffer to specify settings that are more dynamic, perhaps via closures, could be useful.

Constructors

IndentSettings 

Fields

data FBuffer #

Constructors

FBuffer 

Fields

Instances

data MarkSet a #

Constructors

MarkSet 

Fields

Instances

Functor MarkSet # 

Methods

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

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

Foldable MarkSet # 

Methods

fold :: Monoid m => MarkSet m -> m #

foldMap :: Monoid m => (a -> m) -> MarkSet a -> m #

foldr :: (a -> b -> b) -> b -> MarkSet a -> b #

foldr' :: (a -> b -> b) -> b -> MarkSet a -> b #

foldl :: (b -> a -> b) -> b -> MarkSet a -> b #

foldl' :: (b -> a -> b) -> b -> MarkSet a -> b #

foldr1 :: (a -> a -> a) -> MarkSet a -> a #

foldl1 :: (a -> a -> a) -> MarkSet a -> a #

toList :: MarkSet a -> [a] #

null :: MarkSet a -> Bool #

length :: MarkSet a -> Int #

elem :: Eq a => a -> MarkSet a -> Bool #

maximum :: Ord a => MarkSet a -> a #

minimum :: Ord a => MarkSet a -> a #

sum :: Num a => MarkSet a -> a #

product :: Num a => MarkSet a -> a #

Traversable MarkSet # 

Methods

traverse :: Applicative f => (a -> f b) -> MarkSet a -> f (MarkSet b) #

sequenceA :: Applicative f => MarkSet (f a) -> f (MarkSet a) #

mapM :: Monad m => (a -> m b) -> MarkSet a -> m (MarkSet b) #

sequence :: Monad m => MarkSet (m a) -> m (MarkSet a) #

Show a => Show (MarkSet a) # 

Methods

showsPrec :: Int -> MarkSet a -> ShowS #

show :: MarkSet a -> String #

showList :: [MarkSet a] -> ShowS #

Binary a => Binary (MarkSet a) # 

Methods

put :: MarkSet a -> Put #

get :: Get (MarkSet a) #

putList :: [MarkSet a] -> Put #

data Attributes #

Constructors

Attributes 

Fields

data AnyMode #

Constructors

AnyMode (Mode syntax) 

data Mode syntax #

A Mode customizes the Yi interface for editing a particular data format. It specifies when the mode should be used and controls file-specific syntax highlighting and command input, among other things.

Constructors

Mode 

Fields

data IndentBehaviour #

Used to specify the behaviour of the automatic indent command.

Constructors

IncreaseCycle

Increase the indentation to the next higher indentation hint. If we are currently at the highest level of indentation then cycle back to the lowest.

DecreaseCycle

Decrease the indentation to the next smaller indentation hint. If we are currently at the smallest level then cycle back to the largest

IncreaseOnly

Increase the indentation to the next higher hint if no such hint exists do nothing.

DecreaseOnly

Decrease the indentation to the next smaller indentation hint, if no such hint exists do nothing.

type Status = ([Text], StyleName) #

type Statuses = DelayList Status #

data Editor #

The Editor state

Constructors

Editor 

Fields

Instances

MonadState Editor EditorM # 

Methods

get :: EditorM Editor #

put :: Editor -> EditorM () #

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

MonadState Editor YiM # 

Methods

get :: YiM Editor #

put :: Editor -> YiM () #

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

newtype EditorM a #

Constructors

EditorM 

Instances

Monad EditorM # 

Methods

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

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

return :: a -> EditorM a #

fail :: String -> EditorM a #

Functor EditorM # 

Methods

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

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

Applicative EditorM # 

Methods

pure :: a -> EditorM a #

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

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

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

MonadEditor EditorM # 
MonadReader Config EditorM # 

Methods

ask :: EditorM Config #

local :: (Config -> Config) -> EditorM a -> EditorM a #

reader :: (Config -> a) -> EditorM a #

MonadState Editor EditorM # 

Methods

get :: EditorM Editor #

put :: Editor -> EditorM () #

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

HookType (EditorM a) # 

Methods

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

YiAction (EditorM x) x # 

Methods

makeAction :: EditorM x -> Action #

class (Monad m, MonadState Editor m) => MonadEditor m where #

Minimal complete definition

askCfg

Methods

askCfg :: m Config #

withEditor :: EditorM a -> m a #

withEditor_ :: EditorM a -> m () #

runEditor :: Config -> EditorM a -> Editor -> (Editor, a) #

data UIConfig #

Constructors

UIConfig 

Fields

type UIBoot = Config -> ([Event] -> IO ()) -> ([Action] -> IO ()) -> Editor -> IO (UI Editor) #

data CursorStyle #

When should we use a "fat" cursor (i.e. 2 pixels wide, rather than 1)? Fat cursors have only been implemented for the Pango frontend.

data Config #

Configuration record. All Yi hooks can be set here.

Constructors

Config 

Fields

Instances