1{-
2Copyright © 2007-2012 Gracjan Polak
3Copyright © 2012-2016 Ömer Sinan Ağacan
4Copyright © 2017-2020 Albert Krewinkel
5
6Permission is hereby granted, free of charge, to any person obtaining a copy
7of this software and associated documentation files (the "Software"), to deal
8in the Software without restriction, including without limitation the rights
9to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10copies of the Software, and to permit persons to whom the Software is
11furnished to do so, subject to the following conditions:
12
13The above copyright notice and this permission notice shall be included in
14all copies or substantial portions of the Software.
15
16THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
19AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22THE SOFTWARE.
23-}
24{-|
25Module      : Foreign.Lua
26Copyright   : © 2007–2012 Gracjan Polak,
27                2012–2016 Ömer Sinan Ağacan,
28                2017-2020 Albert Krewinkel
29License     : MIT
30Maintainer  : Albert Krewinkel <tarleb+hslua@zeitkraut.de>
31Stability   : beta
32Portability : non-portable (depends on GHC)
33
34Bindings, functions, and utilities enabling the integration of a Lua interpreter
35into a haskell project.
36
37Basic access to the Lua API is provided by '@Foreign.Lua.Core@'.
38-}
39module Foreign.Lua (
40  -- * Core
41    module Foreign.Lua.Core
42  -- * Receiving values from Lua stack (Lua → Haskell)
43  , Peekable (..)
44  , peekEither
45  , peekList
46  , peekKeyValuePairs
47  , peekRead
48  , peekAny
49  -- * Pushing values to Lua stack (Haskell → Lua)
50  , Pushable (..)
51  , pushList
52  , pushAny
53  -- * Calling Functions
54  , PreCFunction
55  , HaskellFunction
56  , ToHaskellFunction (..)
57  , toHaskellFunction
58  , callFunc
59  , newCFunction
60  , freeCFunction
61  , pushHaskellFunction
62  , registerHaskellFunction
63  -- * Utility functions and types
64  , run
65  , run'
66  , runEither
67  , runWith
68  , getglobal'
69  , setglobal'
70  , raiseError
71  , Optional (Optional, fromOptional)
72  -- ** Retrieving values
73  , popValue
74  -- ** Modules
75  , requirehs
76  , preloadhs
77  , create
78  , addfield
79  , addfunction
80  ) where
81
82import Prelude hiding (compare, concat)
83
84import Foreign.Lua.Core
85import Foreign.Lua.FunctionCalling
86import Foreign.Lua.Module
87import Foreign.Lua.Types
88import Foreign.Lua.Userdata ( pushAny, peekAny )
89import Foreign.Lua.Util
90
91