hslua v1.1.0 Release Notes
Release Date: 2020-08-01 // over 3 years ago-
๐ Released 2020-03-25.
โ WARNING: The changes in this release are experimental. It is ๐ recommended to skip this release unless the newly introduced ๐ features are required.
๐ Allow custom error handling: conversion of Lua errors to Haskell exceptions and back is made configurable. Users can define their own exception/error handling strategies, even opening up the option to pass arbitrary exceptions through Lua.
New types exported from
Foreign.Lua.Types
:ErrorConversion
: defines the ways in which exceptions and errors are handled and converted.LuaEnvironment
: environment in which Lua computations are evaluated. Contains the Lua interpreter state and the error conversion strategy.
The environment of the
Lua
type is changed from a plain LuaState
to the above mentionedLuaEnvironment
.New functions
run'
is exported fromForeign.Lua.Util
andForeign.Lua
: it is analogous torun
, but allows to run computations with a custom error conversion strategy.New function
runWithConverter
exported fromForeign.Lua.Core.Types
andForeign.Lua.Core
; likerun'
, but takes a custom state.New function
unsafeRunWith
exported fromForeign.Lua.Core.Types
andForeign.Lua.Core
; runs a computation without proper error handling.New function
errorConversion
exported fromForeign.Lua.Core.Types
andForeign.Lua.Core
: extract the error conversion strategy from the Lua type.New function
throwErrorAsException
exported fromForeign.Lua.Core.Error
andForeign.Lua.Core
: throws a Lua error as Haskell exception, using the current error conversion strategy.
๐ Function
runWith
is moved from moduleForeign.Lua.Core
toForeign.Lua.Util
.The module
Foreign.Lua.Utf8
is now exported.