Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Scratch buffers
Synopsis
- data Scratch :: Effect where
- Show :: Foldable t => t Text -> ScratchOptions -> Scratch m ScratchState
- Update :: Foldable t => ScratchId -> t Text -> Scratch m ScratchState
- Delete :: ScratchId -> Scratch m ()
- Get :: Scratch m [ScratchState]
- Find :: ScratchId -> Scratch m (Maybe ScratchState)
- open :: Member Scratch r => ScratchOptions -> Sem r ScratchState
Documentation
data Scratch :: Effect where Source #
This effect manages scratch buffers, that is, transient buffers displaying text not associated with a file.
See ScratchOptions
for configuration.
Show :: Foldable t => t Text -> ScratchOptions -> Scratch m ScratchState | Open a new scratch buffer and set its content to the supplied text. |
Update :: Foldable t => ScratchId -> t Text -> Scratch m ScratchState | Find a previously defined scratch buffer, ensure it is open and set its content to the supplied text. |
Delete :: ScratchId -> Scratch m () | Close a scratch buffer. |
Get :: Scratch m [ScratchState] | Return the state of all currently managed scratch buffers. |
Find :: ScratchId -> Scratch m (Maybe ScratchState) | Look up a scratch buffer by its ID. |
open :: Member Scratch r => ScratchOptions -> Sem r ScratchState Source #
Create an empty scratch buffer.