lua: add bindings to lua_rotate
@@ -77,6 +77,7 @@ module Lua.Primary
, lua_rawseti
, lua_remove
, lua_replace
+ , lua_rotate
, lua_setglobal
, lua_setmetatable
, lua_settable
@@ -698,6 +699,21 @@ foreign import capi unsafe "lua.h lua_remove"
foreign import capi unsafe "lua.h lua_replace"
lua_replace :: Lua.State -> StackIndex -> IO ()
+-- | Rotates the stack elements between the valid index @idx@ and the
+-- top of the stack. The elements are rotated @n@ positions in the
+-- direction of the top, for a positive @n@, or @-n@ positions in the
+-- direction of the bottom, for a negative @n@. The absolute value of
+-- @n@ must not be greater than the size of the slice being rotated.
+-- This function cannot be called with a pseudo-index, because a
+-- pseudo-index is not an actual stack position.
+--
+-- <https://www.lua.org/manual/5.3/manual.html#lua_rotate>
+foreign import capi unsafe "lua.h lua_rotate"
+ lua_rotate :: Lua.State
+ -> StackIndex -- ^ idx
+ -> CInt -- ^ n
+ -> IO ()
+
-- | Pops a value from the stack and sets it as the new value of global
-- @name@.
--
