rasa-0.1.10: A modular text editor

Safe HaskellNone
LanguageHaskell2010

Rasa.Internal.BufAction

Synopsis

Documentation

newtype BufAction a Source #

This is a monad for performing actions on a specific buffer. You run BufActions by embedding them in a Action via bufferDo or buffersDo

Within a BufAction you can:

  • Use liftAction to run an Action
  • Use liftIO for IO
  • Access/Edit the buffer's text; some commands are available in Rasa.Internal.Actions.
  • Access/edit buffer extensions; see bufExt
  • Embed and sequence BufActions from other extensions

Constructors

BufAction 

Instances

Monad BufAction Source # 

Methods

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

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

return :: a -> BufAction a #

fail :: String -> BufAction a #

Functor BufAction Source # 

Methods

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

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

Applicative BufAction Source # 

Methods

pure :: a -> BufAction a #

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

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

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

MonadIO BufAction Source # 

Methods

liftIO :: IO a -> BufAction a #

HasExtMonad BufAction Source # 

Methods

getExt :: (Typeable * ext, Show ext, Default ext) => BufAction ext Source #

setExt :: (Typeable * ext, Show ext, Default ext) => ext -> BufAction () Source #

overExt :: (Typeable * ext, Show ext, Default ext) => (ext -> ext) -> BufAction () Source #

getText :: BufAction YiString Source #

Returns the text of the current buffer

setText :: YiString -> BufAction () Source #

Sets the text of the current buffer

getBufRef :: BufAction BufRef Source #

Gets the current buffer's BufRef

getRange :: CrdRange -> BufAction YiString Source #

Gets the range of text from the buffer

setRange :: CrdRange -> YiString -> BufAction () Source #

Sets the range of text from the buffer

getBufExt :: (Typeable ext, Show ext, Default ext) => BufAction ext Source #

Retrieve some buffer extension state

setBufExt :: (Typeable ext, Show ext, Default ext) => ext -> BufAction () Source #

Set some buffer extension state

overBufExt :: (Typeable ext, Show ext, Default ext) => (ext -> ext) -> BufAction () Source #

Set some buffer extension state

liftAction :: Action r -> BufAction r Source #

This lifts up an Action to be run inside a BufAction