Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 35 additions & 27 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,75 +58,76 @@ jobs:
- 9.4.8+macOS
- 9.6.5
- 9.8.4
- 9.10.2+ucd2haskell
- 9.12.2
- 9.14.1-alpha
- 9.10.3+ucd2haskell
- 9.12.4
- 9.14.1
# - 9.16.1-alpha
- hlint
include:

- name: 8.2.2
use_haskell_actions: true
ghc_version: 8.2.2
runner: ubuntu-latest
cabal_version: 3.2.0.0
cabal_version: 3.10.3.0
pack_options: DISABLE_TEST=y
ignore_error: false

- name: 8.4.4
ghc_version: 8.4.4
runner: ubuntu-latest
cabal_version: 3.2.0.0
cabal_version: 3.10.3.0
pack_options: DISABLE_TEST=y
ignore_error: false

- name: 8.6.5
ghc_version: 8.6.5
runner: ubuntu-latest
cabal_version: 3.2.0.0
cabal_version: 3.10.3.0
ignore_error: false

- name: 8.8.4
ghc_version: 8.8.4
runner: ubuntu-latest
cabal_version: 3.2.0.0
cabal_version: 3.10.3.0
ignore_error: false

- name: 8.10.7
ghc_version: 8.10.7
runner: ubuntu-latest
cabal_version: 3.2.0.0
cabal_version: 3.10.3.0
ignore_error: false

- name: 9.0.2
ghc_version: 9.0.2
runner: ubuntu-latest
cabal_version: 3.2.0.0
cabal_version: 3.10.3.0
ignore_error: false

- name: 9.2.8+ucd2haskell
ghc_version: 9.2.8
# [NOTE] Oldest version supported by ucd2haskell
pack_options: CABAL_BUILD_OPTIONS="-f ucd2haskell"
runner: ubuntu-latest
cabal_version: 3.6.2.0
cabal_version: 3.10.3.0
ignore_error: false

- name: 9.4.8
ghc_version: 9.4.8
runner: ubuntu-latest
cabal_version: 3.8.1.0
cabal_version: 3.10.3.0
ignore_error: false

- name: 9.4.8+macOS
ghc_version: 9.4.8
runner: macos-latest
cabal_version: 3.10.1.0
cabal_version: 3.10.3.0
ignore_error: false

- name: 9.6.5
ghc_version: 9.6.5
runner: ubuntu-latest
cabal_version: 3.10.1.0
cabal_version: 3.10.3.0
ignore_error: false

- name: 9.8.4
Expand All @@ -135,32 +136,39 @@ jobs:
runner: ubuntu-latest
ignore_error: false

- name: 9.10.2+ucd2haskell
ghc_version: 9.10.2
- name: 9.10.3+ucd2haskell
ghc_version: 9.10.3
cabal_version: 3.12.1.0
pack_options: CABAL_BUILD_OPTIONS="-f ucd2haskell"
runner: ubuntu-latest
ignore_error: false

- name: 9.12.2
ghc_version: 9.12.2
- name: 9.12.4
ghc_version: 9.12.4
cabal_version: 3.14.2.0
runner: ubuntu-latest
ignore_error: false

- name: 9.14.1-alpha
ghc_version: head
cabal_version: 3.16.0.0
pack_options: >
GHCUP_GHC_OPTIONS="-u https://downloads.haskell.org/ghc/9.14.1-alpha1/ghc-9.14.0.20250819-x86_64-deb12-linux.tar.xz"
DISABLE_TEST=y
CABAL_BUILD_OPTIONS="--allow-newer=base,template-haskell"
- name: 9.14.1
ghc_version: 9.14.1
cabal_version: 3.16.1.0
runner: ubuntu-latest
ignore_error: false

# TODO: update to 9.16.1-alpha when available
# - name: 9.16.1-alpha
# ghc_version: head
# cabal_version: 3.18.1.0
# pack_options: >
# GHCUP_GHC_OPTIONS="-u https://downloads.haskell.org/ghc/9.16.1-alpha1/ghc-9.16.0.XXXXX-x86_64-deb12-linux.tar.xz"
# DISABLE_TEST=y
# CABAL_BUILD_OPTIONS="--allow-newer=base,template-haskell"
# runner: ubuntu-latest
# ignore_error: false

# Template for release candidates
# - name: 9.10.0
# ghc_version: 9.8.0.XXXXX
# - name: 9.16.0
# ghc_version: 9.16.0.XXXXX
# ghcup_release_channel: "https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml"
# runner: ubuntu-latest
# cabal_version: latest
Expand All @@ -169,7 +177,7 @@ jobs:
- name: hlint
pack_options: HLINT_OPTIONS="lint" HLINT_TARGETS="lib exe"
runner: ubuntu-latest
cabal_version: 3.2.0.0
cabal_version: 3.10.3.0
ignore_error: false

steps:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This repository provides packages to use the

The Haskell data structures are generated programmatically from the UCD files.
The latest Unicode version supported by these libraries is
[`17.0.0`](https://www.unicode.org/versions/Unicode17.0.0/).
[`18.0.0`](https://www.unicode.org/versions/Unicode18.0.0/).

### `unicode-data`

Expand Down
1 change: 1 addition & 0 deletions experimental/icu/cbits/icu.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <stdbool.h>
#include <unicode/utypes.h>
#include <unicode/uchar.h>
#include <unicode/uscript.h>
Expand Down
9 changes: 5 additions & 4 deletions experimental/icu/icu.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ copyright: 2023 Composewell Technologies and Contributors
category: Data,Text,Unicode
stability: Experimental
build-type: Simple
extra-source-files:
cbits/icu.c
cbits/icu.h

source-repository head
type: git
Expand Down Expand Up @@ -48,9 +51,6 @@ common compile-options
-fwarn-tabs
default-language: Haskell2010

extra-source-files:
cbits/icu.h

library
import: default-extensions, compile-options
if flag(has-icu)
Expand All @@ -68,7 +68,8 @@ library
, text >= 2.0 && < 2.2
include-dirs: cbits
c-sources: cbits/icu.c
cc-options: -Wall -Wextra -pedantic
-- FIXME: -pedantic
cc-options: -Wall -Wextra
extra-libraries: icuuc
pkgconfig-depends:
icu-uc >= 72.1
Expand Down
8 changes: 5 additions & 3 deletions experimental/icu/lib/ICU/Char.chs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import Data.Int (Int8)
import Data.Version (Version, makeVersion)
import Data.Word (Word32)
import Foreign (Ptr)
import Foreign.C (CInt(..))
import Foreign.C (CBool(..), CInt(..))
import Foreign.Marshal.Array (allocaArray, peekArray)
import System.IO.Unsafe (unsafePerformIO)

Expand Down Expand Up @@ -153,11 +153,13 @@ toGeneralCategory = \case
deriving (Bounded, Eq, Ord, Show) #}

foreign import ccall safe "icu.h __hs_u_hasBinaryProperty" u_hasBinaryProperty
:: UChar32 -> CInt -> Bool
:: UChar32 -> CInt -> CBool

hasBinaryProperty :: Char -> UProperty -> Bool
hasBinaryProperty c
= u_hasBinaryProperty (fromIntegral (ord c))
= toEnum
. fromIntegral
. u_hasBinaryProperty (fromIntegral (ord c))
. fromIntegral
. fromEnum

Expand Down
2 changes: 2 additions & 0 deletions experimental/icu/lib/ICU/Scripts.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -294,4 +294,6 @@ data Script
| Tayo -- ^ USCRIPT_TAI_YO = 210
| Tols -- ^ USCRIPT_TOLONG_SIKI = 211
| Hntl -- ^ USCRIPT_TRADITIONAL_HAN_WITH_LATIN = 212
| Pcun -- ^ USCRIPT_PROTO_CUNEIFORM = 213
| Seal -- ^ USCRIPT_SEAL = 214
deriving (Bounded, Enum, Eq, Ord, Show)
11 changes: 6 additions & 5 deletions experimental/unicode-data-text/unicode-data-text.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ tested-with: GHC==8.2.2
, GHC==9.4.8
, GHC==9.6.5
, GHC==9.8.4
, GHC==9.10.2
, GHC==9.12.2
, GHC==9.10.3
, GHC==9.12.4
, GHC==9.14.1

extra-doc-files:
Changelog.md
Expand Down Expand Up @@ -68,7 +69,7 @@ library
build-depends:
base >= 4.7 && < 4.23,
text >= 1.2.4 && < 2.2,
unicode-data >= 0.8 && < 0.9
unicode-data >= 0.9 && < 0.10

test-suite test
import: default-extensions, compile-options
Expand All @@ -82,7 +83,7 @@ test-suite test
base >= 4.7 && < 4.23,
hspec >= 2.0 && < 2.12,
text >= 1.2.4 && < 2.2,
unicode-data >= 0.8 && < 0.9,
unicode-data >= 0.9 && < 0.10,
unicode-data-text
build-tool-depends:
hspec-discover:hspec-discover >= 2.0 && < 2.12
Expand All @@ -98,7 +99,7 @@ benchmark bench
tasty-bench >= 0.2.5 && < 0.6,
tasty >= 1.4.1 && < 1.6,
text >= 1.2.4 && < 2.2,
unicode-data >= 0.8 && < 0.9,
unicode-data >= 0.9 && < 0.10,
unicode-data-text
-- [NOTE] Recommendation of tasty-bench to reduce garbage collection noisiness
ghc-options: -O2 -fdicts-strict -rtsopts -with-rtsopts=-A32m
Expand Down
38 changes: 19 additions & 19 deletions ucd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# we used to generate them earlier are exactly the same as the ones we are
# downloading. To ensure that verfication of the checksum is necessary.

VERSION=17.0.0
VERSION=18.0.0

# When downloading fresh new version comment this out
VERIFY_CHECKSUM=y
Expand All @@ -16,31 +16,31 @@ UCD_URL="https://www.unicode.org/Public/$VERSION/ucd"
# $ find data/$VERSION/ -type f -print0 | xargs -0 sha256sum
# Format: filename:checksum
UCD_FILES="\
Blocks.txt:c0edefaf1a19771e830a82735472716af6bf3c3975f6c2a23ffbe2580fbbcb15\
CaseFolding.txt:ff8d8fefbf123574205085d6714c36149eb946d717a0c585c27f0f4ef58c4183\
DerivedCoreProperties.txt:24c7fed1195c482faaefd5c1e7eb821c5ee1fb6de07ecdbaa64b56a99da22c08\
DerivedNormalizationProps.txt:71fd6a206a2c0cdd41feb6b7f656aa31091db45e9cedc926985d718397f9e488\
NameAliases.txt:793f6f1e4d15fd90f05ae66460191dc4d75d1fea90136a25f30dd6a4cb950eac\
PropertyValueAliases.txt:64e9a5f76f7a1e8b5a47d6a1f9a26522a251208f5276bdfa1559dac7cf2e827a\
PropList.txt:130dcddcaadaf071008bdfce1e7743e04fdfbc910886f017d9f9ac931d8c64dd\
Scripts.txt:9f5e50d3abaee7d6ce09480f325c706f485ae3240912527e651954d2d6b035bf\
ScriptExtensions.txt:ec2107e58825a1586acee8e0911ce18260394ac8b87e535ca325f1ccbeb06bc6\
SpecialCasing.txt:efc25faf19de21b92c1194c111c932e03d2a5eaf18194e33f1156e96de4c9588\
UnicodeData.txt:2e1efc1dcb59c575eedf5ccae60f95229f706ee6d031835247d843c11d96470c\
extracted/DerivedCombiningClass.txt:191463abfbd202703c6fd6776a92a23ac44ec65e0476a7f95aa91ca492cef29b\
extracted/DerivedName.txt:019758bbe6c756c40fca6d505187ea660c5e195533e2ff2c841963a212c9d369\
extracted/DerivedNumericValues.txt:139b976bdc288be01c80f018523da769cf2845109b5a7f0f8a432db64bfedcfa"
Blocks.txt:a58f8d322f3c5e254f9f97b1cbf76a454a7e02de6ac35619a5e4f27aaabfd553\
CaseFolding.txt:a004797658a457bec4dc11683e39f69249ea3b595b752dbea6721c4c9f587b0d\
DerivedCoreProperties.txt:09c928886a178fcafd93c29e4bd59073a058e5a100b716d425cb563ab50f68c9\
DerivedNormalizationProps.txt:98ac7f67d985fe781e317f6182e885e94cabb0c314769e6dd73e48b226931ccd\
NameAliases.txt:3d5cf5e468901b080cd99adf2230061b748083705fe633db43ac8b73ec7a13da\
PropertyValueAliases.txt:06c4c8eaf7b0bf34abe73b113da1215bd784ac254d4c223600b90267caa4bbbd\
PropList.txt:f438f532e8737bb8a2702126cdf9c4af5e357c58c7acf9d9eb2fc7c1a1d955d6\
Scripts.txt:0071fd81b6aeae25f6e8bce8efec3066a6476a91b49bdb2f52dc76e817862a6a\
ScriptExtensions.txt:5c9d34a922f687726f2a8bcf57d49f905987e51f1b21b58c95a00fbe255cec23\
SpecialCasing.txt:8538dea57c184f1ef3783885ea79677b10f6efa06423717157e63712f14d1ad2\
UnicodeData.txt:0736451de439ae7baf1425136617da495e09ee5afbe6e394374db7009ea08950\
extracted/DerivedCombiningClass.txt:ef6b2611cfb660dba3f6b458b9eb4b05f44ed2417302ee7749d7f0f348793121\
extracted/DerivedName.txt:ac6cf808ea4ee29323031d5ba9449de13da51398a3f5ce401546d8fceb976df7\
extracted/DerivedNumericValues.txt:c84f084f83ec6852e1db6e7ef15f340a3af2df8cf0c386ac0d076c2cebd189e6"

# Security files:
# - < 17.0.0: https://www.unicode.org/Public/security/$VERSION/$file)
# - ≥ 17.0.0: https://www.unicode.org/Public/$VERSION/security/$file)
SECURITY_URL="https://www.unicode.org/Public/$VERSION/security"
# Format: filename:checksum
SECURITY_FILES="\
IdentifierStatus.txt:617228a16da13850bf8af28b6cd08f5e9b6595d2eb60404fe6eee2c85b4e4a35\
IdentifierType.txt:924ac63faa97ed73420d6ac48d08279d90968c7da0502ab701e08bfbb9683c22\
confusables.txt:091c7f82fc39ef208faf8f94d29c244de99254675e09de163160c810d13ef22a\
intentional.txt:33738217c15c1a0df0b7a2cc0a0b50b27ebdca119ca11253440ec0102f05626b"
IdentifierStatus.txt:5863c7d99ca18f213c41c7318aa5528bebfb6d32ec0f1d5944e37192c119aebd\
IdentifierType.txt:fa24851acc669e58670e354e7b98a4ec8f52a809ec4f80524b6a60efdb868831\
confusables.txt:6ed3ee967c9dfdf6677d563c9985182fbc50a2efb7d6059cd57b2e2ce18f5b92\
intentional.txt:5b69cdfd7be6be45d51b9cf7ec799df91c1acc47c557d66c92a8d6623df78b0e"

# Download the files

Expand Down
Loading
Loading