{-# OPTIONS_GHC -Wno-warnings-deprecations #-}
module HsLua.Core.Unsafe
( next
)
where
import Control.Monad ((<$!>))
import HsLua.Core.Types (LuaE, StackIndex, liftLua, fromLuaBool)
import Lua.Primary (lua_next)
next :: StackIndex -> LuaE e Bool
next :: forall e. StackIndex -> LuaE e Bool
next StackIndex
idx = (State -> IO Bool) -> LuaE e Bool
forall a e. (State -> IO a) -> LuaE e a
liftLua ((State -> IO Bool) -> LuaE e Bool)
-> (State -> IO Bool) -> LuaE e Bool
forall a b. (a -> b) -> a -> b
$ \State
l -> LuaBool -> Bool
fromLuaBool (LuaBool -> Bool) -> IO LuaBool -> IO Bool
forall (m :: * -> *) a b. Monad m => (a -> b) -> m a -> m b
<$!> State -> StackIndex -> IO LuaBool
lua_next State
l StackIndex
idx
{-# INLINABLE next #-}