Skip to content

HsLua 2.0.0

Choose a tag to compare

@tarleb tarleb released this 22 Oct 18:55
· 707 commits to main since this release
hslua-2.0.0
0a542bd

hslua-2.0.0

Released 2021-10-21.

  • Moved module hierarchy from Foreign.Lua to HsLua.

  • Error handling has been reworked completely. The type of
    exceptions used and handled by HsLua is now exposed to the type
    system. The type Lua makes use of a default error type. Custom
    error handling can be implemented by using the LuaE type with
    an exception type that is an instance of class LuaError.

  • Renamed stack index helpers to nth, nthTop, nthBottom,
    top. The following have been removed: stackTop,
    nthFromTop, nthFromBottom.

  • Extracted raw Lua bindings into new package lua. This means
    that all cabal flags have been moved to package lua as well.
    Version lua-1.0.0 contained the Foreign.Lua.Raw hierarchy as
    present in hslua-1.3.0. See that package's changelog for
    info on the additional modifications since then.

  • The module Foreign.Lua.Raw.Error was merged into the
    HsLua.Core.Error module.

  • The functions getglobal and gettable now return the Lua
    Type of the pushed value.

  • Extracted new packages:

    • hslua-core: the package contains all modules from the
      Core sub-hierarchy.
    • hslua-classes: typclasses Peekable and Pushable for
      pushing and pulling, as well as function calling.
    • tasty-hslua: makes testing helpers available for reuse.
  • Moved run functions from Util to Core.Run.

  • Moved module Utf8 from the base level into Core.

  • Refactored code to expose Haskell functions to Lua:

    • Removed functions newCFunction, freeCFunction. Use
      pushHaskellFunction instead, it takes care of garbage
      collection.

    • Renamed typeclass ToHaskellFunction to Exposable,
      function callFunc to invoke. All these have been moved
      to hslua-classes.

    • The type PreCFunction is now defined in package lua;
      HaskellFunction is defined in hslua-core.

    • Changed pushHaskellFunction to only accept HaskellFunction
      arguments, move it to hslua-core.

    • Removed helper functions addfunction and addfield from
      Module. Use documented functions and fields instead.

  • Added support for a "since" tag on documented functions; allows
    to mark the library version when a function was introduced in
    its present form.