rasa-0.1.5: A modular text editor

Safe HaskellNone
LanguageHaskell2010

Rasa.Internal.Action

Synopsis

Documentation

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

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 ActionState Action Source # 
MonadReader Hooks Action Source # 

Methods

ask :: Action Hooks #

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

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

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

Unwrap and execute an Action (returning the editor state)

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

Unwrap and evaluate an Action (returning the value)

class HasActionState c where Source #

Minimal complete definition

actionState