@@ -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