Copyright | © 2021 Albert Krewinkel |
---|---|
License | MIT |
Maintainer | Albert Krewinkel <tarleb+pandoc@moltkeplatz.de> |
Safe Haskell | None |
Language | Haskell2010 |
Marshaling/unmarshaling functions Lua filters, i.e., tables containing functions to be called on specific elements.
Synopsis
- newtype Filter = Filter (Map Name FilterFunction)
- peekFilter :: LuaError e => Peeker e Filter
- lookup :: Name -> Filter -> Maybe FilterFunction
- member :: Name -> Filter -> Bool
- newtype FilterFunction = FilterFunction Reference
- peekFilterFunction :: Peeker e FilterFunction
- pushFilterFunction :: LuaError e => FilterFunction -> LuaE e ()
- getFunctionFor :: forall a. Data a => Filter -> a -> Maybe FilterFunction
- baseFunctionName :: forall a. Data a => Proxy a -> Name
- listFunctionName :: forall a. Data a => Proxy a -> Name
- valueFunctionNames :: forall a. Data a => Proxy a -> [Name]
Filters
Collection of filter functions (at most one function per element constructor)
peekFilter :: LuaError e => Peeker e Filter Source #
Retrieves a default Filter
object from the stack, suitable for
filtering a full document.
lookup :: Name -> Filter -> Maybe FilterFunction Source #
Looks up a filter function in a Lua Filter
.
member :: Name -> Filter -> Bool Source #
Checks whether the Filter
contains a function of the given name.
Individual filter functions
peekFilterFunction :: Peeker e FilterFunction Source #
Retrieves a filter function from the stack.
The value at the given index must be a function. It is stored in the Lua registry.
pushFilterFunction :: LuaError e => FilterFunction -> LuaE e () Source #
Pushes a filter function to the stack.
Filter functions are stored in the registry and retrieved from there.
getFunctionFor :: forall a. Data a => Filter -> a -> Maybe FilterFunction Source #
Names in filter functions
baseFunctionName :: forall a. Data a => Proxy a -> Name Source #
The name of a type's base function, which is called if there is no more specific function for a value.