hslua-module-text 1.0.0 → 1.0.1
raw patch · 6 files changed
+107/−98 lines, 6 filesdep ~hslua-coredep ~hslua-marshallingdep ~hslua-packagingPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: hslua-core, hslua-marshalling, hslua-packaging, text
API changes (from Hackage documentation)
Files
- CHANGELOG.md +82/−0
- ChangeLog.md +0/−58
- LICENSE +1/−1
- hslua-module-text.cabal +11/−9
- src/HsLua/Module/Text.hs +12/−29
- test/test-hslua-module-text.hs +1/−1
+ CHANGELOG.md view
@@ -0,0 +1,82 @@+# Changelog++`hslua-module-text` uses [PVP Versioning][].++## hslua-module-text-1.0.1++Released 29-01-2022.++- Relaxed upper bound of hslua-core, hslua-marshalling, and+ hslua-packaging, allowing their respective version 2.1.++## hslua-module-text-1.0.0++Released 2021-10-22.++- Use hslua 2.0.++## hslua-module-text-0.3.0.1++Released 2020-10-16.++- Relaxed upper bound for hslua, allow `hslua-1.3.*`.++## hslua-module-text-0.3.0++Released 2020-08-15.++- Use self-documenting module. This allows to include+ documentation with the module definition, and to auto-generate+ documentation from that. Requires hslua-1.2.0 or newer.++- Run CI tests with all GHC 8 versions, test stack builds.++## hslua-module-text-0.2.1++Released 2019-05-04.++- Require at least HsLua v1.0.3: that version has better support+ for modules.++- Rename `pushModuleText` to `pushModule`. The old name is+ keeped as an alias for now.++## hslua-module-text-0.2.0++Released 2018-09-24.++- Use hslua 1.0.++## hslua-module-text-0.1.2.2++Released 2018-03-09.++- Relax upper bound for base.++## hslua-module-text-0.1.2.1++Released 2017-11-24.++- Add missing test file in the sources archive. This oversight+ had caused some stackage test failures.++## hslua-module-text-0.1.2++Released 2017-11-17.++- Run tests with Travis CI.+- Fix problems with GHC 7.8++## hslua-module-text-0.1.1++Released 2017-11-16.++- Lift restriction on base to allow GHC 7.8.++## hslua-module-text-0.1++Released 2017-11-15.++- First version. Released on an unsuspecting world.++ [PVP Versioning]: https://pvp.haskell.org
− ChangeLog.md
@@ -1,58 +0,0 @@-# Revision history for hslua-module-text--## 1.0.0--Release pending.--- Use hslua 2.0.--## 0.3.0.1 -- 2020-10-16--- Relaxed upper bound for hslua, allow `hslua-1.3.*`.--## 0.3.0 -- 2020-08-15--- Use self-documenting module. This allows to include- documentation with the module definition, and to auto-generate- documentation from that. Requires hslua-1.2.0 or newer.--- Run CI tests with all GHC 8 versions, test stack builds.--## 0.2.1 -- 2019-05-04--- Require at least HsLua v1.0.3: that version has better support- for modules.--- Rename `pushModuleText` to `pushModule`. The old name is keeped- as an alias for now.--## 0.2.0 -- 2018-09-24--- Use hslua 1.0.---## 0.1.2.2 -- 2018-03-09--- Relax upper bound for base.---## 0.1.2.1 -- 2017-11-24--- Add missing test file in the sources archive. This oversight had- caused some stackage test failures.---## 0.1.2 -- 2017-11-17--- Run tests with Travis CI.-- Fix problems with GHC 7.8---## 0.1.1 -- 2017-11-16--- Lift restriction on base to allow GHC 7.8.---## 0.1 -- 2017-11-15--- First version. Released on an unsuspecting world.
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2017-2021 Albert Krewinkel+Copyright (c) 2017-2022 Albert Krewinkel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the
hslua-module-text.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: hslua-module-text-version: 1.0.0+version: 1.0.1 synopsis: Lua module for text description: UTF-8 aware subset of Lua's `string` module. .@@ -8,21 +8,23 @@ built around the embeddable scripting language <https://lua.org Lua>. homepage: https://github.com/hslua/hslua+bug-reports: https://github.com/hslua/hslua/issues license: MIT license-file: LICENSE author: Albert Krewinkel maintainer: albert+hslua@zeitkraut.de-copyright: © 2017–2021 Albert Krewinkel+copyright: © 2017–2022 Albert Krewinkel category: Foreign-extra-source-files: ChangeLog.md- test/test-text.lua+extra-source-files: CHANGELOG.md+ , test/test-text.lua tested-with: GHC == 8.0.2 , GHC == 8.2.2 , GHC == 8.4.4 , GHC == 8.6.5 , GHC == 8.8.3- , GHC == 8.10.4+ , GHC == 8.10.7 , GHC == 9.0.1+ , GHC == 9.2.1 source-repository head type: git@@ -32,9 +34,9 @@ common common-options default-language: Haskell2010 build-depends: base >= 4.8 && < 5- , hslua-core >= 2.0 && < 2.1- , hslua-packaging >= 2.0 && < 2.1- , text >= 1.0 && < 1.3+ , hslua-core >= 2.0 && < 2.2+ , hslua-packaging >= 2.0 && < 2.2+ , text >= 1.2 && < 2.1 ghc-options: -Wall -Wincomplete-record-updates -Wnoncanonical-monad-instances@@ -52,7 +54,7 @@ import: common-options exposed-modules: HsLua.Module.Text hs-source-dirs: src- build-depends: hslua-marshalling >= 2.0 && < 2.1+ build-depends: hslua-marshalling >= 2.0 && < 2.2 other-extensions: OverloadedStrings test-suite test-hslua-module-text
src/HsLua/Module/Text.hs view
@@ -24,7 +24,6 @@ import Prelude hiding (reverse) import Data.Text (Text) import Data.Maybe (fromMaybe)-import HsLua.Marshalling (peekIntegral, peekText, pushIntegral, pushText) import HsLua.Packaging import qualified Data.Text as T @@ -53,15 +52,15 @@ len :: DocumentedFunction e len = defun "len" ### liftPure T.length- <#> textParam "s"- =#> intResult "length"+ <#> textParam "s" "UTF-8 encoded string"+ =#> integralResult "length" #? "Determines the number of characters in a string." -- | Wrapper for @'T.toLower'@. lower :: DocumentedFunction e lower = defun "lower" ### liftPure T.toLower- <#> textParam "s"+ <#> textParam "s" "UTF-8 string to convert to lowercase" =#> textResult "Lowercase copy of `s`" #? "Converts a string to lower case." @@ -69,7 +68,7 @@ reverse :: DocumentedFunction e reverse = defun "reverse" ### liftPure T.reverse- <#> textParam "s"+ <#> textParam "s" "UTF-8 string to revert" =#> textResult "Reversed `s`" #? "Reverses a string." @@ -77,9 +76,9 @@ sub :: DocumentedFunction e sub = defun "sub" ### liftPure3 substring- <#> textParam "s"+ <#> textParam "s" "UTF-8 string" <#> textIndex "i" "substring start position"- <#> textOptionalIndex "j" "substring end position"+ <#> opt (textIndex "j" "substring end position") =#> textResult "text substring" #? "Returns a substring, using Lua's string indexing rules." where@@ -94,7 +93,7 @@ upper :: DocumentedFunction e upper = defun "upper" ### liftPure T.toUpper- <#> textParam "s"+ <#> textParam "s" "UTF-8 string to convert to uppercase" =#> textResult "Uppercase copy of `s`" #? "Converts a string to upper case." @@ -102,24 +101,8 @@ -- Parameters -- -textParam :: Text -> Parameter e Text-textParam name =- parameter peekText "string" name "UTF-8 encoded string"--textIndex :: Text -> Text -> Parameter e Int-textIndex = parameter (peekIntegral @Int) "integer"--textOptionalIndex :: Text -> Text -> Parameter e (Maybe Int)-textOptionalIndex = optionalParameter (peekIntegral @Int) "integer"------- Results-----textResult :: Text -- ^ Description- -> FunctionResults e Text-textResult = functionResult pushText "string"--intResult :: Text -- ^ Description- -> FunctionResults e Int-intResult = functionResult (pushIntegral @Int) "integer"+-- | String index parameter+textIndex :: Text -- ^ parameter name+ -> Text -- ^ parameter description+ -> Parameter e Int+textIndex = integralParam @Int
test/test-hslua-module-text.hs view
@@ -2,7 +2,7 @@ {-# LANGUAGE TypeApplications #-} {-| Module : Main-Copyright : © 2017-2021 Albert Krewinkel+Copyright : © 2017-2022 Albert Krewinkel License : MIT Maintainer : Albert Krewinkel <albert+hslua@zeitkraut.de> Stability : stable