Copyright | (c) Sergey Vinokurov 2022 |
---|---|
License | Apache-2.0 (see LICENSE) |
Maintainer | serg.foo@gmail.com |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
Synopsis
- module Emacs.Module.Monad.Class
- data EmacsM (s :: k) (a :: Type)
- runEmacsM :: WithCallStack => Env -> (forall s. EmacsM s a) -> IO a
Documentation
module Emacs.Module.Monad.Class
data EmacsM (s :: k) (a :: Type) Source #
Concrete monad for interacting with Emacs. It provides:
- Ability to call Emacs C functions and automatically rethrows any errors (non-local exits) from elisp as Haskell exceptions.
- Tracks ownership of any produced Emacs values and communicates that to Emacs, so that GC on Emacs side will not make any values in Haskell invalid (funnily enough, this can happen!).
Parameter s
serves to make ownership-tracking capabilities possible.
It's use is the same as in ST
monad. That is, it creates
local threads so that no produced Emacs values can leave past runEmacsM
.