emacs-module-0.1: Utilities to write Emacs dynamic modules

Copyright(c) Sergey Vinokurov 2018
LicenseBSD3-style (see LICENSE)
Maintainerserg.foo@gmail.com
Safe HaskellNone
LanguageHaskell2010

Emacs.Module.Monad

Description

This module defines the implementation of the MonadEmacs.

Documentation

data EmacsM s a Source #

Instances
MonadBase IO (EmacsM s) Source # 
Instance details

Defined in Emacs.Module.Monad

Methods

liftBase :: IO α -> EmacsM s α #

MonadBaseControl IO (EmacsM s) Source # 
Instance details

Defined in Emacs.Module.Monad

Associated Types

type StM (EmacsM s) a :: * #

Methods

liftBaseWith :: (RunInBase (EmacsM s) IO -> IO a) -> EmacsM s a #

restoreM :: StM (EmacsM s) a -> EmacsM s a #

Monad (EmacsM s) Source # 
Instance details

Defined in Emacs.Module.Monad

Methods

(>>=) :: EmacsM s a -> (a -> EmacsM s b) -> EmacsM s b #

(>>) :: EmacsM s a -> EmacsM s b -> EmacsM s b #

return :: a -> EmacsM s a #

fail :: String -> EmacsM s a #

Functor (EmacsM s) Source # 
Instance details

Defined in Emacs.Module.Monad

Methods

fmap :: (a -> b) -> EmacsM s a -> EmacsM s b #

(<$) :: a -> EmacsM s b -> EmacsM s a #

MonadFix (EmacsM s) Source # 
Instance details

Defined in Emacs.Module.Monad

Methods

mfix :: (a -> EmacsM s a) -> EmacsM s a #

Applicative (EmacsM s) Source # 
Instance details

Defined in Emacs.Module.Monad

Methods

pure :: a -> EmacsM s a #

(<*>) :: EmacsM s (a -> b) -> EmacsM s a -> EmacsM s b #

liftA2 :: (a -> b -> c) -> EmacsM s a -> EmacsM s b -> EmacsM s c #

(*>) :: EmacsM s a -> EmacsM s b -> EmacsM s b #

(<*) :: EmacsM s a -> EmacsM s b -> EmacsM s a #

MonadIO (EmacsM s) Source # 
Instance details

Defined in Emacs.Module.Monad

Methods

liftIO :: IO a -> EmacsM s a #

MonadThrow (EmacsM s) Source # 
Instance details

Defined in Emacs.Module.Monad

Methods

throwM :: Exception e => e -> EmacsM s a #

MonadCatch (EmacsM s) Source # 
Instance details

Defined in Emacs.Module.Monad

Methods

catch :: Exception e => EmacsM s a -> (e -> EmacsM s a) -> EmacsM s a #

MonadMask (EmacsM s) Source # 
Instance details

Defined in Emacs.Module.Monad

Methods

mask :: ((forall a. EmacsM s a -> EmacsM s a) -> EmacsM s b) -> EmacsM s b #

uninterruptibleMask :: ((forall a. EmacsM s a -> EmacsM s a) -> EmacsM s b) -> EmacsM s b #

generalBracket :: EmacsM s a -> (a -> ExitCase b -> EmacsM s c) -> (a -> EmacsM s b) -> EmacsM s (b, c) #

MonadResource (EmacsM s) Source # 
Instance details

Defined in Emacs.Module.Monad

Methods

liftResourceT :: ResourceT IO a -> EmacsM s a #

(Throws EmacsThrow, Throws EmacsError, Throws EmacsInternalError) => MonadEmacs EmacsM Source # 
Instance details

Defined in Emacs.Module.Monad

Associated Types

type EmacsRef EmacsM :: k -> Type Source #

type EmacsReturn EmacsM :: k -> Type Source #

Methods

produceRef :: EmacsRef EmacsM s -> EmacsM s (EmacsReturn EmacsM s) Source #

nonLocalExitCheck :: WithCallStack => EmacsM s (FuncallExit ()) Source #

nonLocalExitGet :: WithCallStack => EmacsM s (FuncallExit (EmacsRef EmacsM s, EmacsRef EmacsM s)) Source #

nonLocalExitSignal :: WithCallStack => EmacsRef EmacsM s -> [EmacsRef EmacsM s] -> EmacsM s () Source #

nonLocalExitThrow :: WithCallStack => EmacsRef EmacsM s -> EmacsRef EmacsM s -> EmacsM s () Source #

nonLocalExitClear :: WithCallStack => EmacsM s () Source #

freeValue :: WithCallStack => EmacsRef EmacsM s -> EmacsM s () Source #

makeFunctionExtra :: (WithCallStack, EmacsInvocation req opt rest, GetArities req opt rest) => (forall (s' :: k). (Throws EmacsThrow, Throws EmacsError, Throws EmacsInternalError, Throws UserError) => EmacsArgs req opt rest (EmacsRef EmacsM s') -> Ptr extra -> EmacsM s' (EmacsReturn EmacsM s')) -> ByteString -> Ptr extra -> EmacsM s (EmacsRef EmacsM s) Source #

funcall :: WithCallStack => SymbolName -> [EmacsRef EmacsM s] -> EmacsM s (EmacsRef EmacsM s) Source #

funcallPrimitive :: WithCallStack => SymbolName -> [EmacsRef EmacsM s] -> EmacsM s (EmacsRef EmacsM s) Source #

funcallPrimitive_ :: WithCallStack => SymbolName -> [EmacsRef EmacsM s] -> EmacsM s () Source #

intern :: WithCallStack => SymbolName -> EmacsM s (EmacsRef EmacsM s) Source #

typeOf :: WithCallStack => EmacsRef EmacsM s -> EmacsM s (EmacsRef EmacsM s) Source #

isNotNil :: WithCallStack => EmacsRef EmacsM s -> EmacsM s Bool Source #

eq :: WithCallStack => EmacsRef EmacsM s -> EmacsRef EmacsM s -> EmacsM s Bool Source #

extractWideInteger :: WithCallStack => EmacsRef EmacsM s -> EmacsM s Int64 Source #

makeWideInteger :: WithCallStack => Int64 -> EmacsM s (EmacsRef EmacsM s) Source #

extractDouble :: WithCallStack => EmacsRef EmacsM s -> EmacsM s Double Source #

makeDouble :: WithCallStack => Double -> EmacsM s (EmacsRef EmacsM s) Source #

extractString :: WithCallStack => EmacsRef EmacsM s -> EmacsM s ByteString Source #

makeString :: WithCallStack => ByteString -> EmacsM s (EmacsRef EmacsM s) Source #

extractUserPtr :: WithCallStack => EmacsRef EmacsM s -> EmacsM s (Ptr a) Source #

makeUserPtr :: WithCallStack => UserPtrFinaliser a -> Ptr a -> EmacsM s (EmacsRef EmacsM s) Source #

assignUserPtr :: WithCallStack => EmacsRef EmacsM s -> Ptr a -> EmacsM s () Source #

extractUserPtrFinaliser :: WithCallStack => EmacsRef EmacsM s -> EmacsM s (UserPtrFinaliser a) Source #

assignUserPtrFinaliser :: WithCallStack => EmacsRef EmacsM s -> UserPtrFinaliser a -> EmacsM s () Source #

vecGet :: WithCallStack => EmacsRef EmacsM s -> Int -> EmacsM s (EmacsRef EmacsM s) Source #

vecSet :: WithCallStack => EmacsRef EmacsM s -> Int -> EmacsRef EmacsM s -> EmacsM s () Source #

vecSize :: WithCallStack => EmacsRef EmacsM s -> EmacsM s Int Source #

type StM (EmacsM s) a Source # 
Instance details

Defined in Emacs.Module.Monad

type StM (EmacsM s) a
type EmacsRef EmacsM Source # 
Instance details

Defined in Emacs.Module.Monad

type EmacsReturn EmacsM Source # 
Instance details

Defined in Emacs.Module.Monad

runEmacsM :: Env -> (forall s. EmacsM s a) -> IO a Source #