MIT licensed by Albert Krewinkel
Maintained by Albert Krewinkel
This version can be pinned in stack with:hslua-cli-1.4.3@sha256:490c44fa59b79713251c5c4c2a5e55a4e08c75f608055dfff2e0116b08751679,2901

Module documentation for 1.4.3

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

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

Changes

Changelog

hslua-cli uses PVP Versioning.

hslua-cli-1.4.3

Release pending.

  • Include copyright notice when printing version info; i.e., the behavior is now closer to that of the default lua interpreter.

  • Avoid “redundant import” warning when compiling with GHC 9.10.

hslua-cli-1.4.2

Released 2024-01-18.

  • Relaxed upper bound for text, allowing text-2.1.

hslua-cli-1.4.1

Released 2023-03-18.

  • Always start the REPL if the -i parameter is given on the command line. This fixes a bug where the REPL would not start if -v, -e or -l where given.

hslua-cli-1.4.0.1

Released 2023-03-17.

  • Fix building on Windows.

hslua-cli-1.4.0

Released 2023-03-16.

  • Isocline-based REPL: interactive mode is now supported with the help of a new repl built with the isocline library.

hslua-cli-1.3.0

Released 2023-03-13.

  • Require hslua-core 2.3.

hslua-cli-1.2.0

Released 2022-09-27.

  • The function runStandalone now takes two additional arguments, the program name and list command line args.

hslua-cli-1.1.0

Released 2022-09-26.

  • Added support for the LUA_INIT environment variable. The behavior is as described in the Lua reference manual.

  • Warnings are now enabled when flag -W is given.

hslua-cli-1.0.0

Released 2022-09-23.

  • Initial release.