Skip to content

Commit

Permalink
Add unicodeVersion to all packages APIs.
Browse files Browse the repository at this point in the history
This will allow to query the Unicode version of each package
individually.

Bump packages versions and add changelog entries accordingly.
  • Loading branch information
wismill committed Jun 10, 2024
1 parent abc248b commit dfb502e
Show file tree
Hide file tree
Showing 15 changed files with 111 additions and 8 deletions.
7 changes: 7 additions & 0 deletions ucd2haskell/exe/UCD2Haskell/Generator/Names.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import qualified Unicode.CharacterDatabase.Parser.NameAliases as NA

import qualified UCD2Haskell.Modules.UnicodeData.DerivedNames as Names
import qualified UCD2Haskell.Modules.UnicodeData.NameAliases as NameAliases
import qualified UCD2Haskell.Modules.Version as Version
import UCD2Haskell.Generator (runGenerator)

generateModules :: Version -> FilePath -> FilePath -> IO ()
Expand All @@ -34,3 +35,9 @@ generateModules version indir outdir = do
NA.parse
outdir
[ NameAliases.recipe ]

Version.writeModule
version
outdir
"Unicode.Internal.Char.Names.Version"
"0.3.0"
7 changes: 7 additions & 0 deletions ucd2haskell/exe/UCD2Haskell/Generator/Scripts.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import qualified Unicode.CharacterDatabase.Parser.Properties.Single as Prop

import qualified UCD2Haskell.Modules.Scripts as Scripts
import qualified UCD2Haskell.Modules.ScriptsExtensions as ScriptsExtensions
import qualified UCD2Haskell.Modules.Version as Version
import UCD2Haskell.Generator (runGenerator)

generateModules :: Version -> FilePath -> FilePath -> IO ()
Expand All @@ -33,3 +34,9 @@ generateModules version indir outdir = do
outdir
[ Scripts.recipe scriptAliases
, ScriptsExtensions.recipe scriptAliases extensions ]

Version.writeModule
version
outdir
"Unicode.Internal.Char.Scripts.Version"
"0.2.1"
7 changes: 7 additions & 0 deletions ucd2haskell/exe/UCD2Haskell/Generator/Security.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import qualified UCD2Haskell.Modules.Security.Confusables as Confusables
import qualified UCD2Haskell.Modules.Security.IdentifierStatus as IdentifierStatus
import qualified UCD2Haskell.Modules.Security.IdentifierType as IdentifierType
import qualified UCD2Haskell.Modules.Security.IntentionalConfusables as IntentionalConfusables
import qualified UCD2Haskell.Modules.Version as Version
import UCD2Haskell.Generator (runGenerator)

generateModules :: Version -> FilePath -> FilePath -> IO ()
Expand Down Expand Up @@ -50,3 +51,9 @@ generateModules version indir outdir = do
Prop.parse
outdir
[IntentionalConfusables.recipe]

Version.writeModule
version
outdir
"Unicode.Internal.Char.Security.Version"
"0.2.1"
3 changes: 2 additions & 1 deletion unicode-data-names/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Changelog

## 0.3.0 TDB
## 0.3.0 TBD

- Improve performance.
- Added opional support for `ByteString` API.
Use the package flag `has-bytestring` to enable it.
- Added opional support for `Text` API.
Use the package flag `has-text` to enable it.
- Add `unicodeVersion` to `Unicode.Char.General.Names`.

## 0.2.0 (September 2022)

Expand Down
7 changes: 5 additions & 2 deletions unicode-data-names/lib/Unicode/Char/General/Names.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
-- @since 0.1.0

module Unicode.Char.General.Names
( -- * Name
name
( -- Unicode version
unicodeVersion
-- * Name
, name
, nameOrAlias
, correctedName
-- * Name Aliases
Expand All @@ -36,6 +38,7 @@ import GHC.Exts
import Unicode.Internal.Bits.Names (unpackNBytes#)
import qualified Unicode.Internal.Char.UnicodeData.DerivedName as DerivedName
import qualified Unicode.Internal.Char.UnicodeData.NameAliases as NameAliases
import Unicode.Internal.Char.Names.Version (unicodeVersion)

-- | Name of a character, if defined.
--
Expand Down
20 changes: 20 additions & 0 deletions unicode-data-names/lib/Unicode/Internal/Char/Names/Version.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-- DO NOT EDIT MANUALLY: autogenerated by ucd2haskell
{-# OPTIONS_HADDOCK hide #-}

-- |
-- Module : Unicode.Internal.Char.Names.Version
-- Copyright : (c) 2024 Composewell Technologies and Contributors
-- License : Apache-2.0
-- Maintainer : [email protected]
-- Stability : experimental

module Unicode.Internal.Char.Names.Version (unicodeVersion) where

import Data.Version (Version, makeVersion)

-- | Version of the Unicode standard used by this package:
-- [15.0.0](https://www.unicode.org/versions/Unicode15.0.0/).
--
-- @since 0.3.0
unicodeVersion :: Version
unicodeVersion = makeVersion [15,0,0]
1 change: 1 addition & 0 deletions unicode-data-names/unicode-data-names.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ library
-- the properties are generated.
Unicode.Internal.Char.UnicodeData.DerivedName
Unicode.Internal.Char.UnicodeData.NameAliases
Unicode.Internal.Char.Names.Version
other-modules:
-- Internal files
Unicode.Internal.Bits.Names
Expand Down
4 changes: 4 additions & 0 deletions unicode-data-scripts/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.2.1 TBD

* Add `unicodeVersion` to `Unicode.Char.General.Scripts`.

## 0.2.0.1 (December 2022)

- Fix [Unicode scripts handling on big-endian architectures](https://github.com/composewell/unicode-data/issues/97).
Expand Down
6 changes: 5 additions & 1 deletion unicode-data-scripts/lib/Unicode/Char/General/Scripts.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
--

module Unicode.Char.General.Scripts
( S.Script(..)
( -- * Unicode version
unicodeVersion
-- * Scripts
, S.Script(..)
, script
, scriptExtensions
, scriptDefinition
Expand All @@ -37,6 +40,7 @@ import GHC.Exts (byteSwap32#, narrow32Word#)

import qualified Unicode.Internal.Char.Scripts as S
import qualified Unicode.Internal.Char.ScriptExtensions as S
import Unicode.Internal.Char.Scripts.Version (unicodeVersion)

-- | Character [script](https://www.unicode.org/reports/tr24/).
--
Expand Down
20 changes: 20 additions & 0 deletions unicode-data-scripts/lib/Unicode/Internal/Char/Scripts/Version.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-- DO NOT EDIT MANUALLY: autogenerated by ucd2haskell
{-# OPTIONS_HADDOCK hide #-}

-- |
-- Module : Unicode.Internal.Char.Scripts.Version
-- Copyright : (c) 2024 Composewell Technologies and Contributors
-- License : Apache-2.0
-- Maintainer : [email protected]
-- Stability : experimental

module Unicode.Internal.Char.Scripts.Version (unicodeVersion) where

import Data.Version (Version, makeVersion)

-- | Version of the Unicode standard used by this package:
-- [15.0.0](https://www.unicode.org/versions/Unicode15.0.0/).
--
-- @since 0.2.1
unicodeVersion :: Version
unicodeVersion = makeVersion [15,0,0]
3 changes: 2 additions & 1 deletion unicode-data-scripts/unicode-data-scripts.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.2
name: unicode-data-scripts
version: 0.2.0.1
version: 0.2.1
synopsis: Unicode characters scripts
description:
@unicode-data-scripts@ provides Haskell APIs to access the Unicode
Expand Down Expand Up @@ -75,6 +75,7 @@ library
-- the properties are generated.
Unicode.Internal.Char.Scripts
Unicode.Internal.Char.ScriptExtensions
Unicode.Internal.Char.Scripts.Version

hs-source-dirs: lib
build-depends:
Expand Down
4 changes: 4 additions & 0 deletions unicode-data-security/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.2.1 TBD

- Add `unicodeVersion` to `Unicode.Char.Identifiers.Security`.

## 0.2.0 (September 2022)

- Update to [Unicode 15.0.0](https://www.unicode.org/versions/Unicode15.0.0/).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
-- @since 0.1.0

module Unicode.Char.Identifiers.Security
( -- * Identifier status
isAllowedInIdentifier
( -- * Unicode version
unicodeVersion
-- * Identifier status
, isAllowedInIdentifier

-- * Identifier type
, T.IdentifierType(..)
Expand All @@ -37,6 +39,7 @@ import qualified Unicode.Internal.Char.Security.Confusables as C
import qualified Unicode.Internal.Char.Security.IdentifierStatus as S
import qualified Unicode.Internal.Char.Security.IdentifierType as T
import qualified Unicode.Internal.Char.Security.IntentionalConfusables as IC
import Unicode.Internal.Char.Security.Version (unicodeVersion)

-- | Returns 'True' if the given character is allowed in an identifier.
--
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-- DO NOT EDIT MANUALLY: autogenerated by ucd2haskell
{-# OPTIONS_HADDOCK hide #-}

-- |
-- Module : Unicode.Internal.Char.Security.Version
-- Copyright : (c) 2024 Composewell Technologies and Contributors
-- License : Apache-2.0
-- Maintainer : [email protected]
-- Stability : experimental

module Unicode.Internal.Char.Security.Version (unicodeVersion) where

import Data.Version (Version, makeVersion)

-- | Version of the Unicode standard used by this package:
-- [15.0.0](https://www.unicode.org/versions/Unicode15.0.0/).
--
-- @since 0.2.1
unicodeVersion :: Version
unicodeVersion = makeVersion [15,0,0]
3 changes: 2 additions & 1 deletion unicode-data-security/unicode-data-security.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.2
name: unicode-data-security
version: 0.2.0
version: 0.2.1
synopsis: Unicode security mechanisms database
description:
@unicode-data-security@ provides Haskell APIs to access the
Expand Down Expand Up @@ -77,6 +77,7 @@ library
Unicode.Internal.Char.Security.IdentifierStatus
Unicode.Internal.Char.Security.IdentifierType
Unicode.Internal.Char.Security.IntentionalConfusables
Unicode.Internal.Char.Security.Version

hs-source-dirs: lib
build-depends:
Expand Down

0 comments on commit dfb502e

Please sign in to comment.