diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d46c36e..ec6d99a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,6 +33,7 @@ jobs: - '9.4' - '9.6' - '9.8' + - '9.10' exclude: # TODO: https://github.com/IntersectMBO/bech32/issues/72 # To work around the above issue, we exclude the following versions: @@ -115,7 +116,7 @@ jobs: if: | github.ref == 'refs/heads/main' && matrix.os == 'ubuntu-latest' - && matrix.ghc == '9.8' + && matrix.ghc == '9.10' run: > mv ${{ env.cabal-build-dir }}/build/*/*/*/doc/html/* gh-pages @@ -125,7 +126,7 @@ jobs: if: | github.ref == 'refs/heads/main' && matrix.os == 'ubuntu-latest' - && matrix.ghc == '9.8' + && matrix.ghc == '9.10' uses: JamesIves/github-pages-deploy-action@v4 with: branch: gh-pages diff --git a/bech32-th/ChangeLog.md b/bech32-th/ChangeLog.md index d4a2428..9f83269 100644 --- a/bech32-th/ChangeLog.md +++ b/bech32-th/ChangeLog.md @@ -1,5 +1,9 @@ # ChangeLog for `bech32-th` +## [1.1.7] - 2024-05-20 + +- Added support for GHC 9.10 series. + ## [1.1.6] - 2024-04-24 ### Changed diff --git a/bech32-th/bech32-th.cabal b/bech32-th/bech32-th.cabal index 962decb..2b08ac9 100644 --- a/bech32-th/bech32-th.cabal +++ b/bech32-th/bech32-th.cabal @@ -1,6 +1,6 @@ cabal-version: 3.0 name: bech32-th -version: 1.1.6 +version: 1.1.7 synopsis: Template Haskell extensions to the Bech32 library. description: Template Haskell extensions to the Bech32 library, including quasi-quoters for compile-time checking of Bech32 string @@ -28,13 +28,13 @@ flag release manual: True common dependency-base - build-depends:base >= 4.14.3.0 && < 4.20 + build-depends:base >= 4.14.3.0 && < 4.21 common dependency-bech32 - build-depends:bech32 >= 1.1.5 && < 1.2 + build-depends:bech32 >= 1.1.7 && < 1.2 common dependency-hspec build-depends:hspec >= 2.11.7 && < 2.12 common dependency-template-haskell - build-depends:template-haskell >= 2.16.0.0 && < 2.22 + build-depends:template-haskell >= 2.16.0.0 && < 2.23 common dependency-text build-depends:text >= 1.2.4.1 && < 2.2 diff --git a/bech32/ChangeLog.md b/bech32/ChangeLog.md index a65ecc9..7634a23 100644 --- a/bech32/ChangeLog.md +++ b/bech32/ChangeLog.md @@ -2,6 +2,10 @@ +## [1.1.7] - 2024-05-20 + +- Added support for GHC 9.10 series. + ## [1.1.6] - 2024-04-24 ### Changed diff --git a/bech32/bech32.cabal b/bech32/bech32.cabal index c54c9d9..a10bafa 100644 --- a/bech32/bech32.cabal +++ b/bech32/bech32.cabal @@ -1,6 +1,6 @@ cabal-version: 3.0 name: bech32 -version: 1.1.6 +version: 1.1.7 synopsis: Implementation of the Bech32 cryptocurrency address format (BIP 0173). description: Implementation of the Bech32 cryptocurrency address format documented in the BIP (Bitcoin Improvement Proposal) 0173. @@ -34,7 +34,7 @@ flag static common dependency-array build-depends:array >= 0.5.4.0 && < 0.6 common dependency-base - build-depends:base >= 4.14.3.0 && < 4.20 + build-depends:base >= 4.14.3.0 && < 4.21 common dependency-base58-bytestring build-depends:base58-bytestring >= 0.1.0 && < 0.2 common dependency-bytestring diff --git a/bech32/src/Codec/Binary/Bech32/Internal.hs b/bech32/src/Codec/Binary/Bech32/Internal.hs index 64acd82..f1e99f1 100644 --- a/bech32/src/Codec/Binary/Bech32/Internal.hs +++ b/bech32/src/Codec/Binary/Bech32/Internal.hs @@ -72,40 +72,73 @@ module Codec.Binary.Bech32.Internal ) where -import Prelude - +import Control.Applicative + ( Applicative (pure) ) import Control.Exception ( Exception ) import Control.Monad - ( guard, join ) + ( guard, join, mapM, return, (=<<) ) import Data.Array ( Array ) import Data.Bifunctor ( first ) import Data.Bits ( Bits, testBit, unsafeShiftL, unsafeShiftR, xor, (.&.), (.|.) ) +import Data.Bool + ( Bool, not, otherwise, (&&), (||) ) import Data.ByteString ( ByteString ) import Data.Char - ( chr, ord, toLower, toUpper ) + ( Char, chr, ord, toLower, toUpper ) +import Data.Either + ( Either (Left, Right) ) import Data.Either.Extra ( maybeToEither ) +import Data.Eq + ( Eq ((/=), (==)) ) import Data.Foldable - ( foldl' ) + ( Foldable (length, null), foldl' ) +import Data.Function + ( ($), (.) ) +import Data.Functor + ( Functor (fmap), (<$>) ) import Data.Functor.Identity ( Identity, runIdentity ) +import Data.Int + ( Int ) import Data.Ix ( Ix (..) ) import Data.List - ( sort ) + ( concat, filter, map, reverse, sort, take, zip, (++) ) import Data.Map.Strict ( Map ) import Data.Maybe - ( isNothing, mapMaybe ) + ( Maybe (Just, Nothing), isNothing, mapMaybe ) +import Data.Monoid + ( Monoid ) +import Data.Ord + ( Ord (..) ) +import Data.Semigroup + ( Semigroup ((<>)) ) +import Data.String + ( String ) import Data.Text ( Text ) +import Data.Traversable + ( Traversable (traverse) ) +import Data.Tuple + ( fst, snd ) import Data.Word - ( Word8 ) + ( Word, Word8 ) +import Prelude + ( Bounded (maxBound, minBound) + , Enum (fromEnum, toEnum) + , Integral (mod, rem) + , Num (..) + , fromIntegral + ) +import Text.Show + ( Show ) import qualified Data.Array as Arr import qualified Data.ByteString as BS diff --git a/flake.lock b/flake.lock index 02e8f55..9ba16cd 100644 --- a/flake.lock +++ b/flake.lock @@ -136,22 +136,6 @@ "type": "github" } }, - "flake-utils_2": { - "locked": { - "lastModified": 1679360468, - "narHash": "sha256-LGnza3cfXF10Biw3ZTg0u9o9t7s680Ww200t5KkHTh8=", - "owner": "hamishmack", - "repo": "flake-utils", - "rev": "e1ea268ff47ad475443dbabcd54744b4e5b9d4f5", - "type": "github" - }, - "original": { - "owner": "hamishmack", - "ref": "hkm/nested-hydraJobs", - "repo": "flake-utils", - "type": "github" - } - }, "ghc-8.6.5-iohk": { "flake": false, "locked": { @@ -169,14 +153,51 @@ "type": "github" } }, + "ghc910X": { + "flake": false, + "locked": { + "lastModified": 1714520650, + "narHash": "sha256-4uz6RA1hRr0RheGNDM49a/B3jszqNNU8iHIow4mSyso=", + "ref": "ghc-9.10", + "rev": "2c6375b9a804ac7fca1e82eb6fcfc8594c67c5f5", + "revCount": 62663, + "submodules": true, + "type": "git", + "url": "https://gitlab.haskell.org/ghc/ghc" + }, + "original": { + "ref": "ghc-9.10", + "submodules": true, + "type": "git", + "url": "https://gitlab.haskell.org/ghc/ghc" + } + }, + "ghc911": { + "flake": false, + "locked": { + "lastModified": 1714817013, + "narHash": "sha256-m2je4UvWfkgepMeUIiXHMwE6W+iVfUY38VDGkMzjCcc=", + "ref": "refs/heads/master", + "rev": "fc24c5cf6c62ca9e3c8d236656e139676df65034", + "revCount": 62816, + "submodules": true, + "type": "git", + "url": "https://gitlab.haskell.org/ghc/ghc" + }, + "original": { + "submodules": true, + "type": "git", + "url": "https://gitlab.haskell.org/ghc/ghc" + } + }, "hackage": { "flake": false, "locked": { - "lastModified": 1690331094, - "narHash": "sha256-xGJlmbRruW61N0rEcFn2pRlpLnE1TCKvvyz2nytYzE4=", + "lastModified": 1716165244, + "narHash": "sha256-nLa5/uCdXT5Nq35EYbgz1hYTnwT70Sk/JInM2f1zg4c=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "efc8a53a648a6a3b0973aaefc93ace7d0ddf198d", + "rev": "980c35047cc64f93f4b15c0d3b2338fe18ffe97f", "type": "github" }, "original": { @@ -193,11 +214,19 @@ "cabal-36": "cabal-36", "cardano-shell": "cardano-shell", "flake-compat": "flake-compat", - "flake-utils": "flake-utils_2", "ghc-8.6.5-iohk": "ghc-8.6.5-iohk", + "ghc910X": "ghc910X", + "ghc911": "ghc911", "hackage": "hackage", "hls-1.10": "hls-1.10", "hls-2.0": "hls-2.0", + "hls-2.2": "hls-2.2", + "hls-2.3": "hls-2.3", + "hls-2.4": "hls-2.4", + "hls-2.5": "hls-2.5", + "hls-2.6": "hls-2.6", + "hls-2.7": "hls-2.7", + "hls-2.8": "hls-2.8", "hpc-coveralls": "hpc-coveralls", "hydra": "hydra", "iserv-proxy": "iserv-proxy", @@ -211,16 +240,17 @@ "nixpkgs-2205": "nixpkgs-2205", "nixpkgs-2211": "nixpkgs-2211", "nixpkgs-2305": "nixpkgs-2305", + "nixpkgs-2311": "nixpkgs-2311", "nixpkgs-unstable": "nixpkgs-unstable", "old-ghc-nix": "old-ghc-nix", "stackage": "stackage" }, "locked": { - "lastModified": 1690332668, - "narHash": "sha256-GtrWrvYe5GlUH6adZjcs4Z0yEY+JrGBS2uentXjVNyI=", + "lastModified": 1716166225, + "narHash": "sha256-gFMvOwooBevnHtZyGoiOcRes9ZSylG5YfNoqOHGdP/M=", "owner": "input-output-hk", "repo": "haskell.nix", - "rev": "d9c1f82b37b4226eb22718b657bb80fe961f1cdf", + "rev": "6aa8046087d4e6fd70f3b6b99628f77e398e9fd2", "type": "github" }, "original": { @@ -263,6 +293,125 @@ "type": "github" } }, + "hls-2.2": { + "flake": false, + "locked": { + "lastModified": 1693064058, + "narHash": "sha256-8DGIyz5GjuCFmohY6Fa79hHA/p1iIqubfJUTGQElbNk=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "b30f4b6cf5822f3112c35d14a0cba51f3fe23b85", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.2.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, + "hls-2.3": { + "flake": false, + "locked": { + "lastModified": 1695910642, + "narHash": "sha256-tR58doOs3DncFehHwCLczJgntyG/zlsSd7DgDgMPOkI=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "458ccdb55c9ea22cd5d13ec3051aaefb295321be", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.3.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, + "hls-2.4": { + "flake": false, + "locked": { + "lastModified": 1699862708, + "narHash": "sha256-YHXSkdz53zd0fYGIYOgLt6HrA0eaRJi9mXVqDgmvrjk=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "54507ef7e85fa8e9d0eb9a669832a3287ffccd57", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.4.0.1", + "repo": "haskell-language-server", + "type": "github" + } + }, + "hls-2.5": { + "flake": false, + "locked": { + "lastModified": 1701080174, + "narHash": "sha256-fyiR9TaHGJIIR0UmcCb73Xv9TJq3ht2ioxQ2mT7kVdc=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "27f8c3d3892e38edaef5bea3870161815c4d014c", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.5.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, + "hls-2.6": { + "flake": false, + "locked": { + "lastModified": 1705325287, + "narHash": "sha256-+P87oLdlPyMw8Mgoul7HMWdEvWP/fNlo8jyNtwME8E8=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "6e0b342fa0327e628610f2711f8c3e4eaaa08b1e", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.6.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, + "hls-2.7": { + "flake": false, + "locked": { + "lastModified": 1708965829, + "narHash": "sha256-LfJ+TBcBFq/XKoiNI7pc4VoHg4WmuzsFxYJ3Fu+Jf+M=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "50322b0a4aefb27adc5ec42f5055aaa8f8e38001", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.7.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, + "hls-2.8": { + "flake": false, + "locked": { + "lastModified": 1715153580, + "narHash": "sha256-Vi/iUt2pWyUJlo9VrYgTcbRviWE0cFO6rmGi9rmALw0=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "dd1be1beb16700de59e0d6801957290bcf956a0a", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.8.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, "hpc-coveralls": { "flake": false, "locked": { @@ -326,18 +475,18 @@ "iserv-proxy": { "flake": false, "locked": { - "lastModified": 1688517130, - "narHash": "sha256-hUqfxSlo+ffqVdkSZ1EDoB7/ILCL25eYkcCXW9/P3Wc=", - "ref": "hkm/remote-iserv", - "rev": "9151db2a9a61d7f5fe52ff8836f18bbd0fd8933c", - "revCount": 13, - "type": "git", - "url": "https://gitlab.haskell.org/hamishmack/iserv-proxy.git" + "lastModified": 1708894040, + "narHash": "sha256-Rv+PajrnuJ6AeyhtqzMN+bcR8z9+aEnrUass+N951CQ=", + "owner": "stable-haskell", + "repo": "iserv-proxy", + "rev": "2f2a318fd8837f8063a0d91f329aeae29055fba9", + "type": "github" }, "original": { - "ref": "hkm/remote-iserv", - "type": "git", - "url": "https://gitlab.haskell.org/hamishmack/iserv-proxy.git" + "owner": "stable-haskell", + "ref": "iserv-syms", + "repo": "iserv-proxy", + "type": "github" } }, "lowdown-src": { @@ -443,11 +592,11 @@ }, "nixpkgs-2205": { "locked": { - "lastModified": 1682600000, - "narHash": "sha256-ha4BehR1dh8EnXSoE1m/wyyYVvHI9txjW4w5/oxsW5Y=", + "lastModified": 1685573264, + "narHash": "sha256-Zffu01pONhs/pqH07cjlF10NnMDLok8ix5Uk4rhOnZQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "50fc86b75d2744e1ab3837ef74b53f103a9b55a0", + "rev": "380be19fbd2d9079f677978361792cb25e8a3635", "type": "github" }, "original": { @@ -459,11 +608,11 @@ }, "nixpkgs-2211": { "locked": { - "lastModified": 1685314633, - "narHash": "sha256-8LXBPqTQXl5ofkjpJ18JcbmLJ/lWDoMxtUwiDYv0wro=", + "lastModified": 1688392541, + "narHash": "sha256-lHrKvEkCPTUO+7tPfjIcb7Trk6k31rz18vkyqmkeJfY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c8a17ce7abc03c50cd072e9e6c9b389c5f61836b", + "rev": "ea4c80b39be4c09702b0cb3b42eab59e2ba4f24b", "type": "github" }, "original": { @@ -475,11 +624,11 @@ }, "nixpkgs-2305": { "locked": { - "lastModified": 1685338297, - "narHash": "sha256-+Aq4O0Jn1W1q927ZHc3Zn6RO7bwQGmb6O8xYoGy0KrM=", + "lastModified": 1701362232, + "narHash": "sha256-GVdzxL0lhEadqs3hfRLuj+L1OJFGiL/L7gCcelgBlsw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6287b47dbfabbb8bfbb9b1b53d198ad58a774de4", + "rev": "d2332963662edffacfddfad59ff4f709dde80ffe", "type": "github" }, "original": { @@ -489,6 +638,22 @@ "type": "github" } }, + "nixpkgs-2311": { + "locked": { + "lastModified": 1701386440, + "narHash": "sha256-xI0uQ9E7JbmEy/v8kR9ZQan6389rHug+zOtZeZFiDJk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "293822e55ec1872f715a66d0eda9e592dc14419f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-23.11-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs-regression": { "locked": { "lastModified": 1643052045, @@ -507,17 +672,17 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1685347552, - "narHash": "sha256-9woSppRyUFo26yUffORTzttJ+apOt8MmCv6RxpPNTU4=", + "lastModified": 1694822471, + "narHash": "sha256-6fSDCj++lZVMZlyqOe9SIOL8tYSBz1bI8acwovRwoX8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f2f1ec390714d303cf84ba086e34e45b450dd8c4", + "rev": "47585496bcb13fb72e4a90daeea2f434e2501998", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-unstable", "repo": "nixpkgs", + "rev": "47585496bcb13fb72e4a90daeea2f434e2501998", "type": "github" } }, @@ -602,11 +767,11 @@ "stackage": { "flake": false, "locked": { - "lastModified": 1690330226, - "narHash": "sha256-ApHKqIP/Ubi92lZ0fp8EwiVdM7cejhYA4Hd5Zf8b7d8=", + "lastModified": 1716164362, + "narHash": "sha256-BXJRk20IcsG8uhuLWxA0Lfzx6VVKNEGQ/TINDkd6MH0=", "owner": "input-output-hk", "repo": "stackage.nix", - "rev": "22fbccd7b46469e9405a7c035b8f83682d9c68f1", + "rev": "f27332e59a188f096a67a46fb5d33b0ea1d5a221", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index f988c82..99a1353 100644 --- a/flake.nix +++ b/flake.nix @@ -33,7 +33,7 @@ inherit (nixpkgs) lib; # see flake `variants` below for alternative compilers - defaultCompiler = "ghc8107"; + defaultCompiler = "ghc965"; # We use cabalProject' to ensure we don't build the plan for # all systems. cabalProject = nixpkgs.haskell-nix.cabalProject' ({config, ...}: { @@ -41,31 +41,6 @@ name = "bech32"; compiler-nix-name = lib.mkDefault defaultCompiler; - # we also want cross compilation to windows on linux (and only with default compiler). - crossPlatforms = p: - lib.optional (system == "x86_64-linux" && config.compiler-nix-name == defaultCompiler) - p.mingwW64; - - # tools we want in our shell, from hackage - shell.tools = - { - cabal = "3.10.1.0"; - ghcid = "0.8.8"; - } - // lib.optionalAttrs (config.compiler-nix-name == defaultCompiler) { - # tools that work only with default compiler - #stylish-haskell = "0.14.4.0"; - #hlint = "3.5"; - haskell-language-server = "2.0.0.0"; - }; - # and from nixpkgs or other inputs - shell.nativeBuildInputs = with nixpkgs; [ - ]; - # disable Hoogle until someone request it - shell.withHoogle = false; - # Skip cross compilers for the shell - shell.crossPlatforms = _: []; - # package customizations as needed. Where cabal.project is not # specific enough, or doesn't allow setting these. modules = [ @@ -87,38 +62,11 @@ lib.recursiveUpdate flake rec { project = cabalProject; # add a required job, that's basically all hydraJobs. - hydraJobs = - nixpkgs.callPackages inputs.iohkNix.utils.ciJobsAggregates - { - ciJobs = - flake.hydraJobs + hydraJobs = flake.hydraJobs // { # This ensure hydra send a status for the required job (even if no change other than commit hash) revision = nixpkgs.writeText "revision" (inputs.self.rev or "dirty"); }; - }; - legacyPackages = rec { - inherit cabalProject nixpkgs; - # also provide hydraJobs through legacyPackages to allow building without system prefix: - inherit hydraJobs; - # expose bech32 binary at top-level - bech32 = cabalProject.hsPkgs.bech32.components.exes.bech32; - }; - devShells = let - profillingShell = p: { - # `nix develop .#profiling` (or `.#ghc927.profiling): a shell with profiling enabled - profiling = (p.appendModule {modules = [{enableLibraryProfiling = true;}];}).shell; - }; - in - profillingShell cabalProject - # Additional shells for every GHC version supported by haskell.nix, eg. `nix develop .#ghc927` - // lib.mapAttrs (compiler-nix-name: _: let - p = cabalProject.appendModule {inherit compiler-nix-name;}; - in - p.shell // (profillingShell p)) - nixpkgs.haskell-nix.compiler; - # formatter used by nix fmt - formatter = nixpkgs.alejandra; } ); diff --git a/shell.nix b/shell.nix deleted file mode 100644 index ef0b777..0000000 --- a/shell.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ pkgs ? import (builtins.fetchTarball https://github.com/NixOS/nixpkgs/archive/8ea1ce75929f6d852911061e20717522e00ea47c.tar.gz) {} -, compiler ? "ghc8104" -# , compiler ? "ghc901" -}: - -with pkgs; - -mkShell rec { - name = "bech32-env"; - meta.platforms = lib.platforms.unix; - - ghc = haskell.compiler.${compiler}; - - buildInputs = [ - ghc - cabal-install - stack - nix - ] - ++ ghc.buildInputs - ++ lib.optional (stdenv.hostPlatform.libc == "glibc") glibcLocales - ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ - Cocoa CoreServices libcxx libiconv - ]); - - # Ensure that libz.so and other libraries are available to TH splices. - LD_LIBRARY_PATH = lib.makeLibraryPath buildInputs; - - # Force a UTF-8 locale because many Haskell programs and tests - # assume this. - LANG = "en_US.UTF-8"; - - # Make the shell suitable for the stack nix integration - # - GIT_SSL_CAINFO = "${cacert}/etc/ssl/certs/ca-bundle.crt"; - STACK_IN_NIX_SHELL = "true"; -}