git.iko.soy/typeable/pandoc
on master help sign in
Lua: improve function documentations
commit1f9384542e695ae1a6fcbf9b7ee197a7e689a12a authorAlbert Krewinkel <albert@zeitkraut.de> dateThu 15 Aug 2019, 22:53 (7 years ago) parent2712d3e
1 file changed+4−1
src/Text/Pandoc/Lua/Filter.hs+4−1
src/Text/Pandoc/Lua/Filter.hs+4−1
@@ -93,7 +93,10 @@ pushFilterFunction :: LuaFilterFunction -> Lua ()
9393pushFilterFunction (LuaFilterFunction fnRef) =
9494 Lua.getref Lua.registryindex fnRef
9595
96−
96+-- | Fetch either a list of elements from the stack. If there is a single
97+-- element instead of a list, fetch that element as a singleton list. If the top
98+-- of the stack is nil, return the default element that was passed to this
99+-- function. If none of these apply, raise an error.
97100elementOrList :: Peekable a => a -> Lua [a]
98101elementOrList x = do
99102 let topOfStack = Lua.stackTop