File: README.md

package info (click to toggle)
haskell-hslua-cli 1.4.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 68 kB
  • sloc: haskell: 228; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 639 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
hslua-cli
=========

Library that allows to embed a standalone Lua interpreter into a
larger program. The provided command-line interface is mostly
compatible with that of the default `lua` executable that ships
with Lua.

Example
-------

``` haskell
import HsLua.Core  as Lua (Exception, openlibs, run)
import HsLua.CLI (Settings (..), runStandalone)

-- | Run a default Lua interpreter.
main :: IO ()
main = do
  let settings = Settings
        { settingsVersionInfo = "\nembedded in MyProgram"
        , settingsRunner = \action -> run $ do
            openlibs
            action
        }
  runStandalone @Lua.Exception settings
```