rasa-0.1.7: A modular text editor

Safe HaskellNone
LanguageHaskell2010

Rasa.Internal.Buffer

Synopsis

Documentation

data Buffer Source #

A buffer, holds the text in the buffer and any extension states that are set on the buffer.

class HasBuffer a where Source #

This allows creation of polymorphic lenses over any type which has access to a Buffer

Minimal complete definition

buffer

Methods

buffer :: Lens' a Buffer Source #

text :: HasBuffer b => Lens' b YiString Source #

This lens focuses the text of the in-scope buffer.

bufExt :: forall a s. (Show a, Typeable a, Default a, HasBuffer s) => Lens' s a Source #

bufExt is a lens which will focus a given extension's state within a buffer (within a BufAction). The lens will automagically focus the required extension by using type inference. It's a little bit of magic, if you treat the focus as a member of your extension state it should just work out.

This lens falls back on the extension's Default instance (when getting) if nothing has yet been stored.

data Ext Source #

A wrapper around an extension of any type so it can be stored in an ExtMap

Constructors

Show a => Ext a 

Instances

Show Ext Source # 

Methods

showsPrec :: Int -> Ext -> ShowS #

show :: Ext -> String #

showList :: [Ext] -> ShowS #

mkBuffer :: YiString -> Buffer Source #

Creates a new buffer from the given text.