Skip to content

Commit

Permalink
Add missing docstrings
Browse files Browse the repository at this point in the history
Adding doc strings to `dofile`, `fromType`, and `pushList`.
  • Loading branch information
tarleb committed Aug 13, 2017
1 parent f0f5d76 commit d78db7b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Foreign/Lua/Api.hs
Expand Up @@ -354,6 +354,7 @@ dostring s = do
then pcall 0 multret Nothing
else return loadRes

-- | Loads and runs the given file.
dofile :: FilePath -> Lua Status
dofile fp = do
loadRes <- loadfile fp
Expand Down
1 change: 1 addition & 0 deletions src/Foreign/Lua/Api/Types.hsc
Expand Up @@ -138,6 +138,7 @@ instance Enum Type where
fromEnum = fromIntegral . fromTypeCode . fromType
toEnum = toType . TypeCode . fromIntegral

-- | Convert a lua Type to a type code which can be passed to the C API.
fromType :: Type -> TypeCode
fromType tp = TypeCode $ case tp of
TypeNone -> #{const LUA_TNONE}
Expand Down
1 change: 1 addition & 0 deletions src/Foreign/Lua/Types/ToLuaStack.hs
Expand Up @@ -97,6 +97,7 @@ instance ToLuaStack [Char] where
instance ToLuaStack a => ToLuaStack [a] where
push = pushList

-- | Push list as numerically indexed table.
pushList :: ToLuaStack a => [a] -> Lua ()
pushList xs = do
let setField i x = push x *> rawseti (-2) i
Expand Down

0 comments on commit d78db7b

Please sign in to comment.