All Versions
32
Latest Version
Avg Release Cycle
108 days
Latest Release
1280 days ago

Changelog History
Page 2

  • v1.0.1 Changes

    October 03, 2018

    ๐Ÿ”ฆ Exposed more functions from Lua's lauxlib library:

    • getmetafield,
    • getmetatable',
    • getsubtable, and
    • traceback.

    The function getsubtable is a reimplementation instead of a wrapper
    to the C function for simplicity (thereby avoiding additional C
    wrappers).

    ๐Ÿ›  Fixed tests for GHC 8.6 by no longer depending on failable pattern
    matching.

  • v1.0.0 Changes

    September 24, 2018

    ๐Ÿ†• New features

    Error handling at language borders has been vastly improved and is now
    ๐Ÿ‘ป mostly automatic. Haskell's Foreign.Lua.Exceptions are transformed
    into Lua errors and vice versa. Lua-side wrappers are no longer
    necessary.

    Haskell functions are no longer pushed as userdata by
    pushHaskellFunction, but as C functions. This simplifies tasks where
    Lua expects true function objects object (for example when looking for
    module loaders).

    โž• Added stack instance for

    • Data.Set.Set,
    • Integer,
    • Int,
    • Float, and
    • Double.

    Instances for numbers fall back to strings when the
    representation as a Lua number would cause a loss of precision.

    Haskell functions pushed with pushHaskellFunction can now be
    garbage collected by Lua without having to call back into
    Haskell. The callback into Haskell by the GC had previously
    caused programs to hang in some situations.

    Bindings to more Lua C API functions and macros: isinteger, load,
    loadbuffer, and pushglobaltable.

    Any Haskell value can be pushed to the Lua stack as userdata via
    pushAny and retrieved via peekAny. Additional functions are
    provided to setup the userdata metatable.

    The C preprocessor constants LUA_LOADED_TABLE and
    LUA_PRELOAD_TABLE are made available as
    loadedTableRegistryField and preloadTableRegistryField,
    respectively.

    โž• Additional small helper functions:

    • peekRead -- read value from a string.
    • popValue -- peek value at the top of the Lua stack, then
      โœ‚ remove it from the stack regardless of whether peeking was
      successful or not.

    Naming

    The Lua prefix was removed from types (State, Integer, Number,
    ๐Ÿ‘ป Exception) and the respective infix from functions (try, run,
    runWith, runEither). HsLua should be imported qualified to avoid
    name collisions.

    ๐Ÿ‘ป Terminology now consistently uses exception to refer to Haskell
    exceptions, and error for Lua errors; function names changed
    accordingly (throwException, catchException,
    withExceptionMessage).

    Module Foreign.Lua.Api was renamed to Foreign.Lua.Core.

    Foreign.Lua.lerror was renamed to Foreign.Lua.error.

    Typeclass ToLuaStack was renamed to Pushable.

    Typeclass FromLuaStack was renamed to Peekable.

    ๐Ÿ‘‰ Cabal flag use-pkgconfig was renamed to pkg-config (which is the
    flag name used by other projects such a zlib).

    Type signatures

    ๐Ÿ†• The return value of lua_newuserdata is CSize (was CInt).

    Table index parameter in rawgeti and rawseti must be of type
    LuaInteger, but were of type Int.

    The number of upvalues passed to pushcclosure must be of type
    NumArgs.

    Lua.error has type Lua NumResults, simplifying its use in
    HaskellFunctions.

    Retrieval functions which can fail, i.e. tocfunction, tointeger,
    tonumber, tostring, tothread, and touserdata, use the Maybe
    type to indicate success or failure, avoiding the need to perform
    โž• additional checks.

    โœ‚ Removed Features

    ๐Ÿ‘Œ Support for Lua versions before 5.3 has been dropped.

    ๐Ÿ‘Œ Support for GHC 7.8 has been dropped.

    wrapHaskellFunction has been made internal and is no longer
    exported.

    ๐Ÿ”„ Changed behavior

    Peekable instances for numbers and strings became more forgiving.
    0๏ธโƒฃ Peeking of basic types now follows Lua's default conversion rules:

    • numbers can be given as strings, and vice versa;
    • any value can be converted into a boolean -- only nil and false
      are peeked as False, all other as True.

    Other

    • Many internal improvements and additions such as a benchmarking suite,
      โœ… code cleanups, better tests, etc.
  • v0.9.6

    May 11, 2018
  • v0.9.5 Changes

    April 10, 2018
    • Provide Optional as a replacement for OrNil. Exports of the latter have been fixed.
    • ๐Ÿ‘€ Provide utility function raiseError: Its argument will be thrown as an error in Lua.
    • โž• Add modifyLuaError: The function lives in Foreign.Lua.Error and allows to alter error messages. This is most useful for amending errors with additional information.
    • ๐Ÿ›  Fixed a bug in toList which left a element on the stack if deserializing that element lead to an error. This also affected the FromLuaStack instance for lists.
    • ๐Ÿ›  Fixed a bug in pairsFromTable which left a key-value pair on the stack if either of them could not be read into the expected type. This also affected the FromLuaStack instance for Map.
  • v0.9.5.2 Changes

    July 28, 2018
    • Relaxed upper bounds on exceptions.
  • v0.9.5.1

    April 10, 2018
  • v0.9.4 Changes

    • ๐Ÿ‘‰ Make Lua an instance of MonadMask: MonadMask from Control.Monad.Catch allows to mask asynchronous exceptions. This allows to define a finalizer for Lua operations.
    • โž• Add functions and constants to refer to stack indices: The functions nthFromBottom, nthFromTop as well as the constants stackTop and stackBottom have been introduced. Numeric constants are less clear, and named constants can aid readability.
    • โž• Add type OrNil: This type can be used when dealing with optional arguments to Lua functions.
    • โž• Add function absindex: it converts the acceptable index idx into an equivalent absolute index (that is, one that does not depend on the stack top). The function calls lua_absindex when compiled with Lua 5.2 or later; for Lua 5.1, it is reimplemented in Haskell.
    • ๐Ÿ—„ Functions in tasty which have been deprecated have been replaced with non-deprecated alternatives.
  • v0.9.3 Changes

    • Re-export more FunctionCalling helpers in Foreign.Lua: The typeclass ToHaskellFunction and the helper function toHaskellFunction are useful when working with functions. Importing them separately from Foreign.Lua.FunctionCalling was an unnecessary burden; they are therefor now re-exported by the main module.
    • Export registry-relatd constants refnil and noref: The constants are related to Lua's registry functions (ref and unref).
    • โž• Add helper to convert functions into CFunction: A new helper wrapHaskellFunction is provided. It expects a HaskellImportedFunction userdata (as produced by pushHaskellFunction) on top of the stack and replaces it with a C function. The new function converts error values generated with lerror into Lua errors, i.e. it calls lua_error.
    • โž• Add utility function setglobal': It works like setglobal, but works with packages and nested tables (dot-notation only).
  • v0.9.2 Changes

    • โž• Add cabal flag 'export-dynamic': Default behavior is to include all symbols in the dynamic symbol table, as this enables users to load dynamic lua libraries. However, it is sometimes desirable to disable, e.g., when compiling a fully static binary. See jgm/pandoc#3986.
  • v0.9.1 Changes

    • Increase user-friendlyness of error messages: The error message returned by toHaskellFunction hinted at the fact that the failing function is a Haskell function. This is mostly unnecessary information and might have confused users.