rasa-0.1.0.0: A modular text editor

Safe HaskellNone
LanguageHaskell2010

Rasa.Internal.Action

Synopsis

Documentation

newtype Action a Source #

This is a monad-transformer stack for performing actions against the editor. You register Actions to be run in response to events using eventListener

Within an Action you can:

  • Use liftIO for IO
  • Access/edit extensions that are stored globally, see ext
  • Embed any Actions exported other extensions
  • Embed buffer actions using bufDo and focusDo
  • Add/Edit/Focus buffers and a few other Editor-level things, see the Directive module.

Constructors

Action 

Instances

Monad Action Source # 

Methods

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

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

return :: a -> Action a #

fail :: String -> Action a #

Functor Action Source # 

Methods

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

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

Applicative Action Source # 

Methods

pure :: a -> Action a #

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

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

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

MonadIO Action Source # 

Methods

liftIO :: IO a -> Action a #

MonadState Editor Action Source # 

Methods

get :: Action Editor #

put :: Editor -> Action () #

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

MonadReader Hooks Action Source # 

Methods

ask :: Action Hooks #

local :: (Hooks -> Hooks) -> Action a -> Action a #

reader :: (Hooks -> a) -> Action a #

execAction :: Editor -> Hooks -> Action () -> IO Editor Source #

Unwrap and execute an Action (returning the editor state)

evalAction :: Editor -> Hooks -> Action a -> IO a Source #

Unwrap and evaluate an Action (returning the value)

newtype BufAction a Source #

This is a monad-transformer stack for performing actions on a specific buffer. You register BufActions to be run by embedding them in a scheduled Action via bufferDo or focusDo

Within a BufAction you can:

  • Use liftIO for IO
  • Access/edit buffer extensions; see bufExt
  • Embed and sequence any BufActions from other extensions
  • Access/Edit the buffer's text

Constructors

BufAction 

data Hook Source #

A wrapper around event listeners so they can be stored in Hooks.

Constructors

Hook a 

type Hooks = Map TypeRep [Hook] Source #

A map of Event types to a list of listeners for that event