hslua 2.3.1 → 2.5.0
raw patch · 10 files changed
Files
- CHANGELOG.md +21/−0
- LICENSE +2/−2
- README.md +1/−1
- app/hslua.hs +46/−0
- hslua.cabal +53/−43
- src/HsLua.hs +1/−1
- src/HsLua/Util.hs +1/−1
- test/HsLua/UtilTests.hs +1/−1
- test/HsLuaTests.hs +1/−1
- test/test-hslua.hs +1/−1
CHANGELOG.md view
@@ -2,6 +2,27 @@ `hslua` uses [PVP Versioning][]. +## hslua-2.5.0++Released 2026-01-08.++- Remove deprecated module `HsLua.Packaging.Rendering`.++- Require *hslua-objectorientation* version 2.5.0++- Require *hslua-packaging* version 2.4.0.++- Require *hslua-typing* 0.2.\*.++## hslua-2.4.0++Released 2025-06-23.++- Require hslua-objectorientation-2.4.0++- Provide a full Lua app with Haskell-defined modules preloaded.+ The app is only built if the `executable` flag is enabled.+ ## hslua-2.3.1 Released 2024-01-18.
LICENSE view
@@ -1,7 +1,7 @@-Copyright © 1994-2022 Lua.org, PUC-Rio.+Copyright © 1994-2023 Lua.org, PUC-Rio. Copyright © 2007-2012 Gracjan Polak Copyright © 2012-2015 Ömer Sinan Ağacan-Copyright © 2016-2024 Albert Krewinkel+Copyright © 2016-2026 Albert Krewinkel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the
README.md view
@@ -28,7 +28,7 @@ software and embedded devices. This package provides Haskell bindings to Lua, enable coders to embed the language into their programs, making them scriptable. -HsLua ships with batteries included and includes Lua 5.4.4. Cabal+HsLua ships with batteries included and includes Lua 5.4.7. Cabal flags make it easy to compile against a system-wide Lua installation.
+ app/hslua.hs view
@@ -0,0 +1,46 @@+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE TypeApplications #-}+{- |+Module : Main+Copyright : © 2022-2026 Albert Krewinkel+License : MIT+Maintainer : Albert Krewinkel <tarleb@hslua.org>++A Haskell-wrapped Lua interpreter with Haskell modules.+-}+module Main (main) where+import Control.Monad (when)+import HsLua.Core as Lua+ (Exception, openlibs, pushboolean, registryindex, run, setfield)+import HsLua.Packaging (preloadModule)+import HsLua.CLI (EnvBehavior (IgnoreEnvVars), Settings (..), runStandalone)+import System.Environment (getArgs, getProgName)+import qualified HsLua.Module.Path as Path+import qualified HsLua.Module.System as System+import qualified HsLua.Module.Text as Text+import qualified HsLua.Module.Version as Version+import qualified HsLua.Module.Zip as Zip++-- | Run a default Lua interpreter.+main :: IO ()+main = do+ let settings = Settings+ { settingsVersionInfo = ""+ , settingsRunner = \envBehavior action -> run $ do+ when (envBehavior == IgnoreEnvVars) $ do+ pushboolean True+ setfield registryindex "LUA_NOENV"+ openlibs+ mapM_ preloadModule+ [ Path.documentedModule+ , System.documentedModule+ , Text.documentedModule+ , Version.documentedModule+ , Zip.documentedModule+ ]+ action+ , settingsHistory = Just ".hslua-history"+ }+ prg <- getProgName+ args <- getArgs+ runStandalone @Lua.Exception settings prg args
hslua.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: hslua-version: 2.3.1+version: 2.5.0 synopsis: Bindings to Lua, an embeddable scripting language description: HsLua provides wrappers and helpers to bridge Haskell and <https://www.lua.org/ Lua>.@@ -8,7 +8,7 @@ It builds upon the /lua/ package, which allows to bundle a Lua interpreter with a Haskell program. .- Example programs are can be found in the @hslua-examples@+ Example programs can be found in the @hslua-examples@ subdir of the project <https://github.com/hslua/hslua repository>. homepage: https://hslua.org/@@ -19,53 +19,42 @@ maintainer: tarleb@hslua.org copyright: © 2007–2012 Gracjan Polak; © 2012–2016 Ömer Sinan Ağacan;- © 2017-2024 Albert Krewinkel+ © 2017-2026 Albert Krewinkel category: Foreign build-type: Simple extra-source-files: README.md , CHANGELOG.md , test/lua/*.lua-tested-with: GHC == 8.4.4- , GHC == 8.6.5- , GHC == 8.8.4- , GHC == 8.10.7- , GHC == 9.0.2- , GHC == 9.2.8- , GHC == 9.4.8- , GHC == 9.6.3- , GHC == 9.8.1+tested-with: GHC == 9.6+ , GHC == 9.8+ , GHC == 9.10+ , GHC == 9.12 source-repository head type: git location: https://github.com/hslua/hslua.git +Flag executable+ description: Compile `hslua` standalone executable.+ default: False+ common common-options default-language: Haskell2010- build-depends: base >= 4.11 && < 5- , bytestring >= 0.10.2 && < 0.13- , containers >= 0.5.9 && < 0.8- , exceptions >= 0.8 && < 0.11- , hslua-aeson >= 2.3.1 && < 2.4- , hslua-core >= 2.3.2 && < 2.4- , hslua-classes >= 2.2.1 && < 2.4- , hslua-marshalling >= 2.3.1 && < 2.4- , hslua-objectorientation >= 2.3.1 && < 2.4- , hslua-packaging >= 2.3.1 && < 2.4- , hslua-typing >= 0.1.1 && < 0.2- , mtl >= 2.2 && < 2.4- , text >= 1.2 && < 2.2+ build-depends: base >= 4.11 && < 5 ghc-options: -Wall+ -Wcpp-undef+ -Werror=missing-home-modules+ -Widentities -Wincomplete-record-updates+ -Wincomplete-uni-patterns -Wnoncanonical-monad-instances+ -Wpartial-fields -Wredundant-constraints- if impl(ghc >= 8.2)- ghc-options: -Wcpp-undef- -Werror=missing-home-modules- if impl(ghc >= 8.4)- ghc-options: -Widentities- -Wincomplete-uni-patterns- -Wpartial-fields- -fhide-source-paths+ -fhide-source-paths+ if impl(ghc >= 8.10)+ ghc-options: -Wunused-packages+ if impl(ghc >= 9.0)+ ghc-options: -Winvalid-haddock library import: common-options@@ -86,9 +75,15 @@ , HsLua.Packaging , HsLua.Packaging.Function , HsLua.Packaging.Module- , HsLua.Packaging.Rendering , HsLua.Typing hs-source-dirs: src+ build-depends: hslua-aeson >= 2.3.1 && < 2.4+ , hslua-classes >= 2.2.1 && < 2.4+ , hslua-core >= 2.3.2 && < 2.4+ , hslua-marshalling >= 2.3.1 && < 2.4+ , hslua-objectorientation >= 2.5 && < 2.6+ , hslua-packaging >= 2.4 && < 2.5+ , hslua-typing >= 0.2 && < 0.3 test-suite test-hslua import: common-options@@ -99,16 +94,31 @@ other-modules: HsLuaTests , HsLua.UtilTests build-depends: hslua- -- The lua package is needed only to check for it's- -- version so we know whether to expect behavior of- -- Lua 5.3 or Lua 5.4.- , lua >= 2.0- , lua-arbitrary >= 1.0- , QuickCheck >= 2.7- , quickcheck-instances >= 0.3+ , bytestring >= 0.10.2 && < 0.13+ , exceptions >= 0.8 && < 0.11+ , hslua-core >= 2.3.2 && < 2.4 , tasty-hslua- , tasty >= 0.11- , tasty-hunit >= 0.9+ , tasty >= 0.11+ , tasty-hunit >= 0.9+ , text >= 1.2 && < 2.2 other-extensions: LambdaCase , OverloadedStrings , TypeApplications++executable hslua+ import: common-options+ hs-source-dirs: app+ main-is: hslua.hs+ ghc-options: -rtsopts -with-rtsopts=-A8m -threaded+ if flag(executable)+ buildable: True+ build-depends: hslua-cli+ , hslua-core+ , hslua-packaging+ , hslua-module-path+ , hslua-module-system+ , hslua-module-text+ , hslua-module-version+ , hslua-module-zip+ else+ buildable: False
src/HsLua.hs view
@@ -2,7 +2,7 @@ Module : HsLua Copyright : © 2007–2012 Gracjan Polak; © 2012–2016 Ömer Sinan Ağacan;- © 2017-2024 Albert Krewinkel+ © 2017-2026 Albert Krewinkel License : MIT Maintainer : Albert Krewinkel <tarleb@hslua.org> Stability : beta
src/HsLua/Util.hs view
@@ -2,7 +2,7 @@ Module : HsLua.Util Copyright : © 2007–2012 Gracjan Polak; © 2012–2016 Ömer Sinan Ağacan;- © 2017-2024 Albert Krewinkel+ © 2017-2026 Albert Krewinkel License : MIT Maintainer : Albert Krewinkel <tarleb@hslua.org> Stability : beta
test/HsLua/UtilTests.hs view
@@ -1,7 +1,7 @@ {-# LANGUAGE OverloadedStrings #-} {-| Module : HsLua.UtilTests-Copyright : © 2017-2024 Albert Krewinkel+Copyright : © 2017-2026 Albert Krewinkel License : MIT Maintainer : Albert Krewinkel <tarleb@hslua.org>
test/HsLuaTests.hs view
@@ -3,7 +3,7 @@ {-# LANGUAGE TypeApplications #-} {-| Module : HsLua.Packaging.Module-Copyright : © 2019-2024 Albert Krewinkel+Copyright : © 2019-2026 Albert Krewinkel License : MIT Maintainer : Albert Krewinkel <tarleb@hslua.org> Stability : alpha
test/test-hslua.hs view
@@ -1,6 +1,6 @@ {-| Module : Main-Copyright : © 2017-2024 Albert Krewinkel+Copyright : © 2017-2026 Albert Krewinkel License : MIT Maintainer : Albert Krewinkel <tarleb@hslua.org>