From 0fa9ec35615d9d07105ffddf8ad3b9a7f231c383 Mon Sep 17 00:00:00 2001 From: Ivan Gromakovskii Date: Fri, 5 Jan 2024 18:30:32 +0100 Subject: [PATCH 1/9] [Chore] Drop ghc-8.8 support Problem: supporting ghc-8.8 forces us to have some conditionals in the .cabal file. Not a big deal, but still some overhead. Nowadays this compiler version is rather old, and since we claim to always support 3 versions (as a minimum) it's safe to drop the oldest supported one. Solution: remove it from CI config and tested-with, remove related conditionals. --- .github/workflows/ci.yml | 5 ----- universum.cabal | 19 ++++++------------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f85617..172a5be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,6 @@ jobs: # If you update this list of supported compiler versions, # make sure to update the `tested-with` section of `universum.cabal`. ghc: - - "8.8.4" - "8.10.7" - "9.0.2" - "9.2.8" @@ -46,16 +45,12 @@ jobs: ghc: 9.2.8 - os: macOS-latest ghc: 9.0.2 - - os: macOS-latest - ghc: 8.8.4 - os: macOS-latest ghc: 8.10.7 - os: windows-latest ghc: 9.2.8 - os: windows-latest ghc: 9.0.2 - - os: windows-latest - ghc: 8.8.4 - os: windows-latest ghc: 8.10.7 diff --git a/universum.cabal b/universum.cabal index f23e429..0f772f0 100644 --- a/universum.cabal +++ b/universum.cabal @@ -13,8 +13,7 @@ category: Prelude stability: stable build-type: Simple bug-reports: https://github.com/serokell/universum/issues -tested-with: GHC == 8.8.4 - , GHC == 8.10.7 +tested-with: GHC == 8.10.7 , GHC == 9.0.2 , GHC == 9.2.8 , GHC == 9.4.5 @@ -40,8 +39,7 @@ common common-options -Wno-missing-local-signatures -Wno-monomorphism-restriction -Wno-implicit-prelude - if impl(ghc >= 8.10.1) - ghc-options: -Wno-prepositive-qualified-module + -Wno-prepositive-qualified-module -Wno-inferred-safe-imports if impl(ghc >= 9.2.0) ghc-options: -Wno-missing-kind-signatures @@ -140,9 +138,7 @@ test-suite universum-test build-tool-depends: tasty-discover:tasty-discover - if impl(ghc >= 8.10.1) - ghc-options: -Wno-missing-safe-haskell-mode - + ghc-options: -Wno-missing-safe-haskell-mode ghc-options: -threaded test-suite universum-doctest @@ -157,15 +153,13 @@ test-suite universum-doctest build-depends: doctest , Glob - if impl(ghc >= 8.10.1) - ghc-options: -Wno-missing-safe-haskell-mode + ghc-options: -Wno-missing-safe-haskell-mode + ghc-options: -threaded -- https://github.com/sol/doctest/issues/327 -- TODO: re-enable when the issue is resolved if impl(ghc >= 9.0.0) buildable: False - ghc-options: -threaded - benchmark universum-benchmark import: common-options type: exitcode-stdio-1.0 @@ -179,8 +173,7 @@ benchmark universum-benchmark , text , unordered-containers - if impl(ghc >= 8.10.1) - ghc-options: -Wno-missing-safe-haskell-mode + ghc-options: -Wno-missing-safe-haskell-mode default-extensions: NoImplicitPrelude ScopedTypeVariables From 5ff90cb123d6f0ef56098b35ac15320e2060e9b8 Mon Sep 17 00:00:00 2001 From: Ivan Gromakovskii Date: Fri, 5 Jan 2024 21:31:44 +0100 Subject: [PATCH 2/9] [#288] Re-enable Stackage LTS badge Problem: Stackage LTS badge in the README was commented out due when the package got eliminated. However, now it's available, so there is no reason to have the badge commented out. Solution: uncomment it. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4a3b9cf..fe14305 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ Universum [![GitHub CI](https://github.com/serokell/universum/workflows/CI/badge.svg)](https://github.com/serokell/universum/actions) [![Hackage](https://img.shields.io/hackage/v/universum.svg)](https://hackage.haskell.org/package/universum) - - +[![Stackage LTS](http://stackage.org/package/universum/badge/lts)](http://stackage.org/lts/package/universum) + [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) From 4598ba8943b86e412b832e5f1df560bb98b6d665 Mon Sep 17 00:00:00 2001 From: Ivan Gromakovskii Date: Fri, 5 Jan 2024 21:37:17 +0100 Subject: [PATCH 3/9] [Chore] Replace TypeInType with DataKinds Problem: TypeInType extension got deprecated recently, we are still using it in Debug.hs. Solution: enable DataKinds instead. --- src/Universum/Debug.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Universum/Debug.hs b/src/Universum/Debug.hs index f69cee4..ded5551 100644 --- a/src/Universum/Debug.hs +++ b/src/Universum/Debug.hs @@ -1,4 +1,5 @@ {-# LANGUAGE CPP #-} +{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DerivingStrategies #-} @@ -8,7 +9,6 @@ {-# LANGUAGE PolyKinds #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE Trustworthy #-} -{-# LANGUAGE TypeInType #-} -- | Functions for debugging. If you left these functions in your code -- then warning is generated to remind you about left usages. Also, some From 797e08510be360f19686d3450b874c77b9c67469 Mon Sep 17 00:00:00 2001 From: Ivan Gromakovskii Date: Fri, 5 Jan 2024 21:21:04 +0100 Subject: [PATCH 4/9] [Chore] Update Stackage resolver and Stack version on CI Problem: there is a newer LTS version than specified in stack.yaml, and a newer Stack version than specified in the CI config. It's not a problem per-se, but it's a good practice to update all versions from time to time. Solution: 1. Update the resolver in stack.yaml to the latest LTS one at the moment of doing this change (lts-22.4). 2. Update Stack version in ci.yml to the latest released one (2.13.1). 3. Update the GHC version there to match the one implied by the resolver. --- .github/workflows/ci.yml | 4 ++-- stack.yaml | 2 +- stack.yaml.lock | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 172a5be..2ffa666 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -90,8 +90,8 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - stack: ["2.9.3"] - ghc: ["9.4.5"] + stack: ["2.13.1"] + ghc: ["9.6.3"] steps: - uses: actions/checkout@v4 diff --git a/stack.yaml b/stack.yaml index bb875e4..2d0dc93 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1 +1 @@ -resolver: lts-21.0 +resolver: lts-22.4 diff --git a/stack.yaml.lock b/stack.yaml.lock index ad1be6c..f71a69f 100644 --- a/stack.yaml.lock +++ b/stack.yaml.lock @@ -6,7 +6,7 @@ packages: [] snapshots: - completed: - sha256: 1867d84255dff8c87373f5dd03e5a5cb1c10a99587e26c8793e750c54e83ffdc - size: 639139 - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/21/0.yaml - original: lts-21.0 + sha256: 8b211c5a6aad3787e023dfddaf7de7868968e4f240ecedf14ad1c5b2199046ca + size: 714097 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/4.yaml + original: lts-22.4 From 8a3cdfb5a11c7cba2e4fd35664330bcaf125a28f Mon Sep 17 00:00:00 2001 From: Ivan Gromakovskii Date: Fri, 5 Jan 2024 21:34:04 +0100 Subject: [PATCH 5/9] [Chore] Support ghc-9.6.3 explicitly Problem: we don't claim to support ghc-9.6.3, it's time to do so. Solution: 1. Add 9.6.3 to tested-with. 2. Test it with cabal on CI on all platforms. As a consequence, 9.4 will be tested only on Linux from now on. Also update the Cabal version in CI config while we are at it. --- .github/workflows/ci.yml | 7 ++++++- universum.cabal | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ffa666..1b7ac49 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macOS-latest, windows-latest] - cabal: ["3.8"] + cabal: ["3.10"] # If you update this list of supported compiler versions, # make sure to update the `tested-with` section of `universum.cabal`. ghc: @@ -39,14 +39,19 @@ jobs: - "9.0.2" - "9.2.8" - "9.4.5" + - "9.6.3" # Use only the latest compiler on non-Linux exclude: + - os: macOS-latest + ghc: 9.4.5 - os: macOS-latest ghc: 9.2.8 - os: macOS-latest ghc: 9.0.2 - os: macOS-latest ghc: 8.10.7 + - os: windows-latest + ghc: 9.4.5 - os: windows-latest ghc: 9.2.8 - os: windows-latest diff --git a/universum.cabal b/universum.cabal index 0f772f0..c670823 100644 --- a/universum.cabal +++ b/universum.cabal @@ -17,6 +17,7 @@ tested-with: GHC == 8.10.7 , GHC == 9.0.2 , GHC == 9.2.8 , GHC == 9.4.5 + , GHC == 9.6.3 extra-doc-files: CHANGES.md , CONTRIBUTING.md , README.md From 414203eb72eae1901e72f11f82df1e1968260331 Mon Sep 17 00:00:00 2001 From: Ivan Gromakovskii Date: Sun, 7 Jan 2024 21:12:05 +0100 Subject: [PATCH 6/9] [Chore] Support ghc-9.8.1 Problem: there is ghc-9.8 for a while, but we don't support it for several reasons. Solution: 1. Permit text up to 2.1.1 (currently the latest one). The rewrite rules still work and benchmarks produce expected results. 2. Add explicit kind signatures for custom operators, because otherwise there is a warning. 3. Add 9.8.1 to tested-with. 4. Update the CI config accordingly. Let's still consider 9.6 as the main version (it's probably more popular) and use it for 3 OS. --- .github/workflows/ci.yml | 7 ++++++- src/Universum/String/Conversion.hs | 2 +- src/Universum/TypeOps.hs | 21 ++++++++++++--------- universum.cabal | 3 ++- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b7ac49..95faccc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,8 +40,11 @@ jobs: - "9.2.8" - "9.4.5" - "9.6.3" - # Use only the latest compiler on non-Linux + - "9.8.1" + # Use only the "main" (usually latest) compiler version on non-Linux exclude: + - os: macOS-latest + ghc: 9.8.1 - os: macOS-latest ghc: 9.4.5 - os: macOS-latest @@ -50,6 +53,8 @@ jobs: ghc: 9.0.2 - os: macOS-latest ghc: 8.10.7 + - os: windows-latest + ghc: 9.8.1 - os: windows-latest ghc: 9.4.5 - os: windows-latest diff --git a/src/Universum/String/Conversion.hs b/src/Universum/String/Conversion.hs index d9a3c9f..67e9bc7 100644 --- a/src/Universum/String/Conversion.hs +++ b/src/Universum/String/Conversion.hs @@ -177,7 +177,7 @@ are still the expected ones (see the comments there for what to expect). * You may optionally check whether any changes to `pack` and `unpack` functions and their `INLINE`/`NOINLINE` annotations took place. The current rewrite rules match with what happens in `text` package -at the e5644b663c32c01a1de7299a5e711216755e01bc commit, and next time +at the c826a6cb3d29242ce3632b490670ae7997689eaa commit, and next time you can just check `git diff ..HEAD`. If these points hold, it should be safe to raise the upper bound on `text` version. diff --git a/src/Universum/TypeOps.hs b/src/Universum/TypeOps.hs index afeb7ca..c7a7cdb 100644 --- a/src/Universum/TypeOps.hs +++ b/src/Universum/TypeOps.hs @@ -1,12 +1,13 @@ -{-# LANGUAGE ConstraintKinds #-} -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE ExplicitNamespaces #-} -{-# LANGUAGE KindSignatures #-} -{-# LANGUAGE NoImplicitPrelude #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE Safe #-} -{-# LANGUAGE TypeFamilies #-} -{-# LANGUAGE TypeOperators #-} +{-# LANGUAGE ConstraintKinds #-} +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE ExplicitNamespaces #-} +{-# LANGUAGE KindSignatures #-} +{-# LANGUAGE NoImplicitPrelude #-} +{-# LANGUAGE PolyKinds #-} +{-# LANGUAGE Safe #-} +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE StandaloneKindSignatures #-} +{-# LANGUAGE TypeOperators #-} -- | Type operators for writing convenient type signatures. @@ -25,6 +26,7 @@ import Data.Kind (Constraint) -- = -- f :: Either String (Maybe Int) -- @ +type ($) :: (k2 -> k1) -> k2 -> k1 type f $ a = f a infixr 2 $ @@ -66,4 +68,5 @@ type family Each (c :: [k -> Constraint]) (as :: [k]) where -- = -- a :: (Show a, Read a) => a -> a -- @ +type With :: [k -> Constraint] -> k -> Constraint type With a b = a <+> b diff --git a/universum.cabal b/universum.cabal index c670823..b0418b0 100644 --- a/universum.cabal +++ b/universum.cabal @@ -18,6 +18,7 @@ tested-with: GHC == 8.10.7 , GHC == 9.2.8 , GHC == 9.4.5 , GHC == 9.6.3 + , GHC == 9.8.1 extra-doc-files: CHANGES.md , CONTRIBUTING.md , README.md @@ -106,7 +107,7 @@ library , stm -- Make sure that "toString-toText-rewritting" note -- is still valid when bumping this constraint. - , text >= 1.0.0.0 && <= 2.0.2 + , text >= 1.0.0.0 && <= 2.1.1 , transformers , unordered-containers , utf8-string From a65f7a8a1bfc3f9f7c9920a3263bb66119bffdad Mon Sep 17 00:00:00 2001 From: Ivan Gromakovskii Date: Fri, 8 Mar 2024 22:48:24 +0100 Subject: [PATCH 7/9] [Chore] Disable x-partial warning in benchmarks In benchmarks we don't care that much about runtime safety. --- universum.cabal | 2 ++ 1 file changed, 2 insertions(+) diff --git a/universum.cabal b/universum.cabal index b0418b0..e9496d9 100644 --- a/universum.cabal +++ b/universum.cabal @@ -176,6 +176,8 @@ benchmark universum-benchmark , unordered-containers ghc-options: -Wno-missing-safe-haskell-mode + if impl(ghc >= 9.8.0) + ghc-options: -Wno-x-partial default-extensions: NoImplicitPrelude ScopedTypeVariables From 94ed12f1544e202499df40c536779a575c7367a6 Mon Sep 17 00:00:00 2001 From: Ivan Gromakovskii Date: Mon, 11 Mar 2024 10:29:04 +0100 Subject: [PATCH 8/9] [Chore] Mention a caveat regarding StringProps tests See the comment, should be clear. --- test/Test/Universum/StringProps.hs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/Test/Universum/StringProps.hs b/test/Test/Universum/StringProps.hs index ac02079..8caafdf 100644 --- a/test/Test/Universum/StringProps.hs +++ b/test/Test/Universum/StringProps.hs @@ -1,3 +1,8 @@ +-- Some tests in this module have a caveat: they depend on compiler +-- optimizations and will likely fail if compiled with -O0. +-- That's because they depend on rewrite rules (and test these rules), +-- and these rules are usually not triggered without certain optimizations. + module Test.Universum.StringProps ( hprop_StringToTextAndBack , hprop_StringToTextAndBackSurrogate From 6b8b1c4ddc18737cac61edf5cda3dc266e0b8146 Mon Sep 17 00:00:00 2001 From: Ivan Gromakovskii Date: Fri, 8 Mar 2024 22:45:08 +0100 Subject: [PATCH 9/9] [Chore] Prepare the next release --- CHANGES.md | 7 +++++++ universum.cabal | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index e1e1d60..73c0c8d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,10 @@ +1.8.2.1 +======= + +* [#293](https://github.com/serokell/universum/pull/293) + * Add explicit kind signatures for custom operators. + * Bump some dependency constraints to support GHC-9.8. + 1.8.2 ===== diff --git a/universum.cabal b/universum.cabal index e9496d9..3eb6ffd 100644 --- a/universum.cabal +++ b/universum.cabal @@ -1,6 +1,6 @@ cabal-version: 2.2 name: universum -version: 1.8.2 +version: 1.8.2.1 synopsis: Custom prelude used in Serokell description: See README.md file for more details. homepage: https://github.com/serokell/universum