Skip to content
This repository was archived by the owner on Mar 22, 2021. It is now read-only.

Commit f1e5070

Browse files
committed
Improve documentation for Callback and AnyValue
1 parent b5641a3 commit f1e5070

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/Foreign/Lua/Module/SystemUtils.hs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ import Control.Exception (IOException, try)
2121
import Foreign.Lua (Lua, NumResults(..), Peekable, Pushable, StackIndex)
2222
import qualified Foreign.Lua as Lua
2323

24-
-- | Lua callback function
24+
-- | Lua callback function. This type is similar to @'AnyValue'@, and
25+
-- the same caveats apply.
2526
newtype Callback = Callback StackIndex
2627

2728
instance Peekable Callback where
@@ -35,7 +36,11 @@ instance Pushable Callback where
3536
push (Callback idx) = Lua.pushvalue idx
3637

3738

38-
-- | Any value of unknown type
39+
-- | Any value of unknown type.
40+
--
41+
-- This simply wraps the function's index on the Lua stack. Changes to
42+
-- the stack may only be made with great care, as they can break the
43+
-- reference.
3944
newtype AnyValue = AnyValue { fromAnyValue :: StackIndex }
4045

4146
instance Peekable AnyValue where

0 commit comments

Comments
 (0)