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

Data.Emacs.Module.Args

Contents

Description

 
Synopsis

Documentation

data Nat Source #

Constructors

Z 
S Nat 

type family EmacsArgs (req :: Nat) (opt :: Nat) (rest :: Bool) (a :: Type) = (r :: Type) | r -> req opt rest a where ... Source #

Equations

EmacsArgs (S n) opt rest a = R a (EmacsArgs n opt rest a) 
EmacsArgs Z (S k) rest a = O a (EmacsArgs Z k rest a) 
EmacsArgs Z Z True a = Rest a 
EmacsArgs Z Z False a = Stop a 

class EmacsInvocation req opt rest where Source #

Minimal complete definition

supplyEmacsArgs

Methods

supplyEmacsArgs :: MonadBase IO m => Int -> Ptr RawValue -> (RawValue -> m a) -> (EmacsArgs req opt rest a -> m b) -> m b Source #

Instances
EmacsInvocation Z Z False Source # 
Instance details

Defined in Data.Emacs.Module.Args

Methods

supplyEmacsArgs :: MonadBase IO m => Int -> Ptr RawValue -> (RawValue -> m a) -> (EmacsArgs Z Z False a -> m b) -> m b Source #

EmacsInvocation Z Z True Source # 
Instance details

Defined in Data.Emacs.Module.Args

Methods

supplyEmacsArgs :: MonadBase IO m => Int -> Ptr RawValue -> (RawValue -> m a) -> (EmacsArgs Z Z True a -> m b) -> m b Source #

EmacsInvocation Z n rest => EmacsInvocation Z (S n) rest Source # 
Instance details

Defined in Data.Emacs.Module.Args

Methods

supplyEmacsArgs :: MonadBase IO m => Int -> Ptr RawValue -> (RawValue -> m a) -> (EmacsArgs Z (S n) rest a -> m b) -> m b Source #

EmacsInvocation n opt rest => EmacsInvocation (S n) opt rest Source # 
Instance details

Defined in Data.Emacs.Module.Args

Methods

supplyEmacsArgs :: MonadBase IO m => Int -> Ptr RawValue -> (RawValue -> m a) -> (EmacsArgs (S n) opt rest a -> m b) -> m b Source #

class GetArities (req :: Nat) (opt :: Nat) (rest :: Bool) where Source #

Minimal complete definition

arities

Methods

arities :: Proxy req -> Proxy opt -> Proxy rest -> (CPtrdiff, CPtrdiff) Source #

Instances
NatValue req => GetArities req opt True Source # 
Instance details

Defined in Data.Emacs.Module.Args

Methods

arities :: Proxy req -> Proxy opt -> Proxy True -> (CPtrdiff, CPtrdiff) Source #

(NatValue req, NatValue opt) => GetArities req opt False Source # 
Instance details

Defined in Data.Emacs.Module.Args

Methods

arities :: Proxy req -> Proxy opt -> Proxy False -> (CPtrdiff, CPtrdiff) Source #

Argument inference

data R a b Source #

Required argument.

Constructors

R !a !b 

data O a b Source #

Optional argument.

Constructors

O !(Maybe a) !b 

newtype Rest a Source #

All other arguments as a list.

Constructors

Rest [a] 

data Stop a Source #

No more arguments.

Constructors

Stop