Safe Haskell | None |
---|---|
Language | Haskell2010 |
- newtype Action a = Action {}
- newtype BufAction a = BufAction {
- getBufAction :: Free BufActionF a
- data ActionF next where
- LiftIO :: IO next -> ActionF next
- BufferDo :: [BufRef] -> BufAction r -> ([r] -> next) -> ActionF next
- DispatchActionAsync :: IO (Action ()) -> next -> ActionF next
- AsyncActionProvider :: ((Action () -> IO ()) -> IO ()) -> next -> ActionF next
- AddBuffer :: YiString -> (BufRef -> next) -> ActionF next
- GetBufRefs :: ([BufRef] -> next) -> ActionF next
- GetExt :: (Typeable ext, Show ext, Default ext) => (ext -> next) -> ActionF next
- SetExt :: (Typeable ext, Show ext, Default ext) => ext -> next -> ActionF next
- GetEditor :: (Editor -> next) -> ActionF next
- GetBuffer :: BufRef -> (Maybe Buffer -> next) -> ActionF next
- Exit :: next -> ActionF next
- ShouldExit :: (Bool -> next) -> ActionF next
- data BufActionF next where
- GetText :: (YiString -> next) -> BufActionF next
- SetText :: YiString -> next -> BufActionF next
- GetBufRef :: (BufRef -> next) -> BufActionF next
- GetBufExt :: (Typeable ext, Show ext, Default ext) => (ext -> next) -> BufActionF next
- SetBufExt :: (Typeable ext, Show ext, Default ext) => ext -> next -> BufActionF next
- SetRange :: CrdRange -> YiString -> next -> BufActionF next
- LiftAction :: Action r -> (r -> next) -> BufActionF next
- BufLiftIO :: IO next -> BufActionF next
- liftActionF :: ActionF a -> Action a
- liftBufAction :: BufActionF a -> BufAction a
Documentation
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
Action
s exported other extensions - Embed buffer actions using
bufDo
orbuffersDo
- Add/Edit/Focus buffers and a few other Editor-level things, see the Rasa.Internal.Actions module.
This is a monad for performing actions on a specific buffer.
You run BufAction
s by embedding them in a Action
via bufferDo
or
buffersDo
Within a BufAction you can:
- Use
liftAction
to run anAction
- 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
BufAction
s from other extensions
data ActionF next where Source #
Free Monad Actions for Action
LiftIO :: IO next -> ActionF next | |
BufferDo :: [BufRef] -> BufAction r -> ([r] -> next) -> ActionF next | |
DispatchActionAsync :: IO (Action ()) -> next -> ActionF next | |
AsyncActionProvider :: ((Action () -> IO ()) -> IO ()) -> next -> ActionF next | |
AddBuffer :: YiString -> (BufRef -> next) -> ActionF next | |
GetBufRefs :: ([BufRef] -> next) -> ActionF next | |
GetExt :: (Typeable ext, Show ext, Default ext) => (ext -> next) -> ActionF next | |
SetExt :: (Typeable ext, Show ext, Default ext) => ext -> next -> ActionF next | |
GetEditor :: (Editor -> next) -> ActionF next | |
GetBuffer :: BufRef -> (Maybe Buffer -> next) -> ActionF next | |
Exit :: next -> ActionF next | |
ShouldExit :: (Bool -> next) -> ActionF next |
data BufActionF next where Source #
Free Monad Actions for BufAction
GetText :: (YiString -> next) -> BufActionF next | |
SetText :: YiString -> next -> BufActionF next | |
GetBufRef :: (BufRef -> next) -> BufActionF next | |
GetBufExt :: (Typeable ext, Show ext, Default ext) => (ext -> next) -> BufActionF next | |
SetBufExt :: (Typeable ext, Show ext, Default ext) => ext -> next -> BufActionF next | |
SetRange :: CrdRange -> YiString -> next -> BufActionF next | |
LiftAction :: Action r -> (r -> next) -> BufActionF next | |
BufLiftIO :: IO next -> BufActionF next |
liftActionF :: ActionF a -> Action a Source #
Embeds a ActionF type into the Action Monad
liftBufAction :: BufActionF a -> BufAction a Source #
Embeds a BufActionF type into the BufAction Monad