rasa-0.1.9: A modular text editor

Safe HaskellNone
LanguageHaskell2010

Rasa.Internal.Action

Synopsis

Documentation

newtype Action a Source #

This is a monad for performing actions against the editor. You can register Actions to be run in response to events using onEveryTrigger

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 or buffersDo
  • Add/Edit/Focus buffers and a few other Editor-level things, see the Rasa.Internal.Actions module.

Constructors

Action 

Fields

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 # 

runAction :: ActionState -> Action a -> IO (a, ActionState) Source #

Runs an Action into an IO

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

Evals an Action into an IO

execAction :: ActionState -> Action a -> IO ActionState Source #

Execs an Action into an IO

data ActionState Source #

This contains all data representing the editor's state. It acts as the state object for an 'Action

data Listener Source #

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

Constructors

Listener ListenerId (a -> Action ()) 

data ListenerId Source #

An opaque reverence to a specific registered event-listener. A ListenerId is used only to remove listeners later with removeListener.

Constructors

ListenerId Int TypeRep 

type Listeners = Map TypeRep [Listener] Source #

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