yi-core-0.19.4: 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 Source #

Constructors

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

Instances

Instances details
Show Action Source # 
Instance details

Defined in Yi.Types

Methods

showsPrec :: Int -> Action -> ShowS

show :: Action -> String

showList :: [Action] -> ShowS

Eq Action Source # 
Instance details

Defined in Yi.Types

Methods

(==) :: Action -> Action -> Bool

(/=) :: Action -> Action -> Bool

YiAction Action () Source # 
Instance details

Defined in Yi.Keymap

class (Default a, Binary a, Typeable a) => YiVariable a Source #

Instances

Instances details
YiVariable CabalBuffer Source # 
Instance details

Defined in Yi.Command

YiVariable Histories Source # 
Instance details

Defined in Yi.History

YiVariable RegionStyle Source # 
Instance details

Defined in Yi.Types

class (Default a, Typeable a) => YiConfigVariable a Source #

Instances

Instances details
YiConfigVariable Evaluator Source # 
Instance details

Defined in Yi.Eval

type Interact ev a = I ev Action a Source #

data IsRefreshNeeded Source #

Instances

Instances details
Show IsRefreshNeeded Source # 
Instance details

Defined in Yi.Types

Methods

showsPrec :: Int -> IsRefreshNeeded -> ShowS

show :: IsRefreshNeeded -> String

showList :: [IsRefreshNeeded] -> ShowS

Eq IsRefreshNeeded Source # 
Instance details

Defined in Yi.Types

data Yi Source #

Constructors

Yi 

Fields

Instances

Instances details
MonadReader Yi YiM Source # 
Instance details

Defined in Yi.Types

Methods

ask :: YiM Yi

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

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

newtype YiM a Source #

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

Constructors

YiM 

Fields

Instances

Instances details
Applicative YiM Source # 
Instance details

Defined in Yi.Types

Methods

pure :: a -> YiM a

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

liftA2 :: (a -> b -> c) -> YiM a -> YiM b -> YiM c

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

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

Functor YiM Source # 
Instance details

Defined in Yi.Types

Methods

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

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

Monad YiM Source # 
Instance details

Defined in Yi.Types

Methods

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

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

return :: a -> YiM a

MonadFail YiM Source # 
Instance details

Defined in Yi.Types

Methods

fail :: String -> YiM a

MonadEditor YiM Source # 
Instance details

Defined in Yi.Types

MonadReader Yi YiM Source # 
Instance details

Defined in Yi.Types

Methods

ask :: YiM Yi

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

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

MonadState Editor YiM Source # 
Instance details

Defined in Yi.Types

Methods

get :: YiM Editor

put :: Editor -> YiM ()

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

MonadBase IO YiM Source # 
Instance details

Defined in Yi.Types

Methods

liftBase :: IO α -> YiM α Source #

HookType (YiM a) Source # 
Instance details

Defined in Yi.Hooks

Methods

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

YiAction (YiM x) x Source # 
Instance details

Defined in Yi.Keymap

Methods

makeAction :: YiM x -> Action Source #

unsafeWithEditor :: Config -> MVar YiVar -> EditorM a -> IO a Source #

data KeymapSet Source #

Constructors

KeymapSet 

Fields

newtype BufferM a Source #

The BufferM monad writes the updates performed.

Constructors

BufferM 

Fields

Instances

Instances details
Applicative BufferM Source # 
Instance details

Defined in Yi.Types

Methods

pure :: a -> BufferM a

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

liftA2 :: (a -> b -> c) -> BufferM a -> BufferM b -> BufferM c

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

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

Functor BufferM Source # 
Instance details

Defined in Yi.Types

Methods

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

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

Monad BufferM Source # 
Instance details

Defined in Yi.Types

Methods

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

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

return :: a -> BufferM a

MonadFail BufferM Source # 
Instance details

Defined in Yi.Types

Methods

fail :: String -> BufferM a

MonadReader Window BufferM Source # 
Instance details

Defined in Yi.Types

Methods

ask :: BufferM Window

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

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

MonadState FBuffer BufferM Source # 
Instance details

Defined in Yi.Types

Methods

get :: BufferM FBuffer

put :: FBuffer -> BufferM ()

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

YiAction (BufferM x) x Source # 
Instance details

Defined in Yi.Keymap

data IndentSettings Source #

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

Instances

Instances details
Show IndentSettings Source # 
Instance details

Defined in Yi.Types

Methods

showsPrec :: Int -> IndentSettings -> ShowS

show :: IndentSettings -> String

showList :: [IndentSettings] -> ShowS

Eq IndentSettings Source # 
Instance details

Defined in Yi.Types

data FBuffer Source #

Constructors

FBuffer 

Fields

Instances

Instances details
Binary FBuffer 
Instance details

Defined in Yi.Buffer.Misc

Methods

put :: FBuffer -> Put

get :: Get FBuffer

putList :: [FBuffer] -> Put

Show FBuffer 
Instance details

Defined in Yi.Buffer.Misc

Methods

showsPrec :: Int -> FBuffer -> ShowS

show :: FBuffer -> String

showList :: [FBuffer] -> ShowS

Eq FBuffer Source # 
Instance details

Defined in Yi.Types

Methods

(==) :: FBuffer -> FBuffer -> Bool

(/=) :: FBuffer -> FBuffer -> Bool

MonadState FBuffer BufferM Source # 
Instance details

Defined in Yi.Types

Methods

get :: BufferM FBuffer

put :: FBuffer -> BufferM ()

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

data MarkSet a Source #

Constructors

MarkSet 

Fields

Instances

Instances details
Functor MarkSet Source # 
Instance details

Defined in Yi.Types

Methods

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

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

Foldable MarkSet Source # 
Instance details

Defined in Yi.Types

Methods

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

foldMap :: Monoid m => (a -> m) -> MarkSet a -> 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 Source # 
Instance details

Defined in Yi.Types

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)

Binary a => Binary (MarkSet a) Source # 
Instance details

Defined in Yi.Types

Methods

put :: MarkSet a -> Put

get :: Get (MarkSet a)

putList :: [MarkSet a] -> Put

Show a => Show (MarkSet a) Source # 
Instance details

Defined in Yi.Types

Methods

showsPrec :: Int -> MarkSet a -> ShowS

show :: MarkSet a -> String

showList :: [MarkSet a] -> ShowS

data Attributes Source #

Constructors

Attributes 

Fields

Instances

Instances details
Binary Attributes Source # 
Instance details

Defined in Yi.Types

Methods

put :: Attributes -> Put

get :: Get Attributes

putList :: [Attributes] -> Put

data BufferId Source #

Constructors

MemBuffer !Text 
FileBuffer !FilePath 

Instances

Instances details
Binary BufferId Source # 
Instance details

Defined in Yi.Types

Methods

put :: BufferId -> Put

get :: Get BufferId

putList :: [BufferId] -> Put

Show BufferId Source # 
Instance details

Defined in Yi.Types

Methods

showsPrec :: Int -> BufferId -> ShowS

show :: BufferId -> String

showList :: [BufferId] -> ShowS

Eq BufferId Source # 
Instance details

Defined in Yi.Types

Methods

(==) :: BufferId -> BufferId -> Bool

(/=) :: BufferId -> BufferId -> Bool

Ord BufferId Source # 
Instance details

Defined in Yi.Types

Methods

compare :: BufferId -> BufferId -> Ordering

(<) :: BufferId -> BufferId -> Bool

(<=) :: BufferId -> BufferId -> Bool

(>) :: BufferId -> BufferId -> Bool

(>=) :: BufferId -> BufferId -> Bool

max :: BufferId -> BufferId -> BufferId

min :: BufferId -> BufferId -> BufferId

data SelectionStyle Source #

Constructors

SelectionStyle 

Fields

Instances

Instances details
Binary SelectionStyle Source # 
Instance details

Defined in Yi.Types

Methods

put :: SelectionStyle -> Put

get :: Get SelectionStyle

putList :: [SelectionStyle] -> Put

Show SelectionStyle Source # 
Instance details

Defined in Yi.Types

Methods

showsPrec :: Int -> SelectionStyle -> ShowS

show :: SelectionStyle -> String

showList :: [SelectionStyle] -> ShowS

data AnyMode Source #

Constructors

AnyMode (Mode syntax) 

data Mode syntax Source #

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

Instances

Instances details
Binary (Mode syntax)

Just stores the mode name.

Instance details

Defined in Yi.Buffer.Misc

Methods

put :: Mode syntax -> Put

get :: Get (Mode syntax)

putList :: [Mode syntax] -> Put

data IndentBehaviour Source #

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.

Instances

Instances details
Show IndentBehaviour Source # 
Instance details

Defined in Yi.Types

Methods

showsPrec :: Int -> IndentBehaviour -> ShowS

show :: IndentBehaviour -> String

showList :: [IndentBehaviour] -> ShowS

Eq IndentBehaviour Source # 
Instance details

Defined in Yi.Types

type Status = ([Text], StyleName) Source #

type Statuses = DelayList Status Source #

data Editor Source #

The Editor state

Constructors

Editor 

Fields

Instances

Instances details
Binary Editor 
Instance details

Defined in Yi.Editor

Methods

put :: Editor -> Put

get :: Get Editor

putList :: [Editor] -> Put

MonadState Editor EditorM Source # 
Instance details

Defined in Yi.Types

Methods

get :: EditorM Editor

put :: Editor -> EditorM ()

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

MonadState Editor YiM Source # 
Instance details

Defined in Yi.Types

Methods

get :: YiM Editor

put :: Editor -> YiM ()

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

newtype EditorM a Source #

Constructors

EditorM 

Fields

Instances

Instances details
Applicative EditorM Source # 
Instance details

Defined in Yi.Types

Methods

pure :: a -> EditorM a

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

liftA2 :: (a -> b -> c) -> EditorM a -> EditorM b -> EditorM c

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

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

Functor EditorM Source # 
Instance details

Defined in Yi.Types

Methods

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

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

Monad EditorM Source # 
Instance details

Defined in Yi.Types

Methods

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

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

return :: a -> EditorM a

MonadFail EditorM Source # 
Instance details

Defined in Yi.Types

Methods

fail :: String -> EditorM a

MonadEditor EditorM Source # 
Instance details

Defined in Yi.Types

MonadReader Config EditorM Source # 
Instance details

Defined in Yi.Types

Methods

ask :: EditorM Config

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

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

MonadState Editor EditorM Source # 
Instance details

Defined in Yi.Types

Methods

get :: EditorM Editor

put :: Editor -> EditorM ()

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

HookType (EditorM a) Source # 
Instance details

Defined in Yi.Hooks

Methods

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

YiAction (EditorM x) x Source # 
Instance details

Defined in Yi.Keymap

class (Monad m, MonadState Editor m) => MonadEditor (m :: Type -> Type) where Source #

Minimal complete definition

askCfg

Methods

askCfg :: m Config Source #

withEditor :: EditorM a -> m a Source #

withEditor_ :: EditorM a -> m () Source #

Instances

Instances details
MonadEditor EditorM Source # 
Instance details

Defined in Yi.Types

MonadEditor YiM Source # 
Instance details

Defined in Yi.Types

data UIConfig Source #

Constructors

UIConfig 

Fields

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

data CursorStyle Source #

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

Configuration record. All Yi hooks can be set here.

Constructors

Config 

Fields

Instances

Instances details
MonadReader Config EditorM Source # 
Instance details

Defined in Yi.Types

Methods

ask :: EditorM Config

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

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

MonadState Config ConfigM 
Instance details

Defined in Yi.Config.Simple.Types

Methods

get :: ConfigM Config

put :: Config -> ConfigM ()

state :: (Config -> (a, Config)) -> ConfigM a

data RegionStyle Source #

Instances

Instances details
Binary RegionStyle Source # 
Instance details

Defined in Yi.Types

Methods

put :: RegionStyle -> Put

get :: Get RegionStyle

putList :: [RegionStyle] -> Put

Default RegionStyle Source # 
Instance details

Defined in Yi.Types

Show RegionStyle Source # 
Instance details

Defined in Yi.Types

Methods

showsPrec :: Int -> RegionStyle -> ShowS

show :: RegionStyle -> String

showList :: [RegionStyle] -> ShowS

Eq RegionStyle Source # 
Instance details

Defined in Yi.Types

Methods

(==) :: RegionStyle -> RegionStyle -> Bool

(/=) :: RegionStyle -> RegionStyle -> Bool

YiVariable RegionStyle Source # 
Instance details

Defined in Yi.Types