Mark all return values of failable operations
All return values which use the custom error indicator protocol are
marked with Failable.
@@ -412,12 +412,12 @@ foreign import ccall safe "lua.h lua_pushthread"
-- | Wrapper around <https://lua.org/manual/5.3/manual.html#lua_gettable \
-- @lua_gettable@> which catches any @longjmp@s.
foreign import ccall "safer-api.h hslua_gettable"
- hslua_gettable :: LuaState -> StackIndex -> IO CInt
+ hslua_gettable :: LuaState -> StackIndex -> IO (Failable CInt)
-- | Wrapper around <https://lua.org/manual/5.3/manual.html#lua_getfield \
-- @lua_getfield@> which catches any @longjmp@s.
foreign import ccall "safer-api.h hslua_getfield"
- hslua_getfield :: LuaState -> StackIndex -> Ptr CChar -> IO CInt
+ hslua_getfield :: LuaState -> StackIndex -> Ptr CChar -> IO (Failable CInt)
-- | See <https://www.lua.org/manual/5.3/manual.html#lua_rawget lua_rawget>
#ifdef ALLOW_UNSAFE_GC
@@ -462,7 +462,7 @@ foreign import ccall safe "lua.h lua_getmetatable"
-- | Wrapper around <https://lua.org/manual/5.3/manual.html#lua_getglobal \
-- @lua_getglobal@> which catches any @longjmp@s.
foreign import ccall "safer-api.h hslua_getglobal"
- hslua_getglobal :: LuaState -> Ptr CChar -> IO CInt
+ hslua_getglobal :: LuaState -> Ptr CChar -> IO (Failable CInt)
--------------------------------------------------------------------------------
@@ -476,12 +476,12 @@ foreign import ccall "safer-api.h hslua_getglobal"
-- | Wrapper around <https://lua.org/manual/5.3/manual.html#lua_settable \
-- @lua_settable@> which catches any @longjmp@s.
foreign import ccall "safer-api.h hslua_settable"
- hslua_settable :: LuaState -> StackIndex -> IO CInt
+ hslua_settable :: LuaState -> StackIndex -> IO (Failable CInt)
-- | Wrapper around <https://lua.org/manual/5.3/manual.html#lua_setfield \
-- @lua_setfield@> which catches any @longjmp@s.
foreign import ccall "safer-api.h hslua_setfield"
- hslua_setfield :: LuaState -> StackIndex -> Ptr CChar -> IO CInt
+ hslua_setfield :: LuaState -> StackIndex -> Ptr CChar -> IO (Failable CInt)
-- | See <https://www.lua.org/manual/5.3/manual.html#lua_rawset lua_rawset>
#ifdef ALLOW_UNSAFE_GC
@@ -510,7 +510,7 @@ foreign import ccall safe "lua.h lua_setmetatable"
-- | Wrapper around <https://lua.org/manual/5.3/manual.html#lua_setglobal \
-- @lua_setglobal@> which catches any @longjmp@s.
foreign import ccall "safer-api.h hslua_setglobal"
- hslua_setglobal :: LuaState -> Ptr CChar -> IO CInt
+ hslua_setglobal :: LuaState -> Ptr CChar -> IO (Failable CInt)
--------------------------------------------------------------------------------
