diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 7ea568c..8866e5f 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -49,7 +49,7 @@ checkmark indicating that you are sure it is dealt with (be that by irrelevance) - Record your changes - - [ ] I added an entry to the [changelog](https://github.com/serokell/universum/tree/master/CHANGES.md) if my changes are visible to the users + - [ ] I added an entry to the [changelog](https://github.com/serokell/universum/tree/master/CHANGES.md) (creating the `Unreleased` section if necessary) if my changes are visible to the users and - [ ] provided a migration guide for breaking changes if possible diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 66bfdad..d82aaf7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,29 +31,33 @@ jobs: strategy: matrix: os: [ubuntu-latest, macOS-latest, windows-latest] - cabal: ["3.6"] + cabal: ["3.8"] # If you update this list of supported compiler versions, # make sure to update the `tested-with` section of `universum.cabal`. ghc: - - "8.6.5" - "8.8.4" - "8.10.7" - - "9.0.1" - - "9.2.2" + - "9.0.2" + - "9.2.8" + - "9.4.5" # Use only the latest compiler on non-Linux exclude: - os: macOS-latest - ghc: 9.0.1 + ghc: 9.2.8 + - os: macOS-latest + ghc: 9.0.2 - os: macOS-latest ghc: 8.8.4 - os: macOS-latest - ghc: 8.6.5 + ghc: 8.10.7 + - os: windows-latest + ghc: 9.2.8 - os: windows-latest - ghc: 9.0.1 + ghc: 9.0.2 - os: windows-latest ghc: 8.8.4 - os: windows-latest - ghc: 8.6.5 + ghc: 8.10.7 steps: - uses: actions/checkout@v3 @@ -91,8 +95,8 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - stack: ["2.7"] - ghc: ["9.0.2"] + stack: ["2.9.3"] + ghc: ["9.4.5"] steps: - uses: actions/checkout@v3 diff --git a/CHANGES.md b/CHANGES.md index f14a9ef..e1e1d60 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,8 +1,17 @@ +1.8.2 +===== + +* [#289](https://github.com/serokell/universum/pull/289): + Make universum work with LTS-21.0. + * Re-export `(~)` type operator. +* [#283](https://github.com/serokell/universum/pull/283): + Bump the upper version bound on `text` to `2.0.2`. + 1.8.1.1 ======= * [#282](https://github.com/serokell/universum/pull/282): - Bump version bound on `text` to `2.0.1`. + Bump the upper version bound on `text` to `2.0.1`. 1.8.1 ===== diff --git a/src/Universum/Base.hs b/src/Universum/Base.hs index 6b657fd..a191be8 100644 --- a/src/Universum/Base.hs +++ b/src/Universum/Base.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE Unsafe #-} @@ -24,6 +25,9 @@ module Universum.Base , module Data.Proxy , module Data.Typeable , module Data.Void +#if MIN_VERSION_base(4,17,0) + , module Data.Type.Equality +#endif , module GHC.Base , module GHC.Enum @@ -67,6 +71,9 @@ import Data.Traversable (Traversable (..), fmapDefault, foldMapDefault, forM, ma import Data.Proxy (Proxy (..)) import Data.Typeable (Typeable) import Data.Void (Void, absurd, vacuous) +#if MIN_VERSION_base(4,17,0) +import Data.Type.Equality (type (~)) +#endif import GHC.Base (String, asTypeOf, maxInt, minInt, ord, seq) import GHC.Enum (Bounded (..), Enum (..), boundedEnumFrom, boundedEnumFromThen) diff --git a/src/Universum/Container/Class.hs b/src/Universum/Container/Class.hs index 3a483cd..81b1246 100644 --- a/src/Universum/Container/Class.hs +++ b/src/Universum/Container/Class.hs @@ -231,9 +231,13 @@ instance FromList (NonEmpty a) where instance FromList IntSet instance Ord a => FromList (Set a) -instance (Eq k, Hashable k) => FromList (HashMap k v) instance FromList (IntMap v) instance Ord k => FromList (Map k v) +#if MIN_VERSION_hashable(1,4,0) +instance (Hashable k) => FromList (HashMap k v) +#else +instance (Eq k, Hashable k) => FromList (HashMap k v) +#endif instance FromList T.Text instance FromList TL.Text @@ -575,7 +579,11 @@ instance Ord v => Container (Set v) where notElem = Set.notMember {-# INLINE notElem #-} +#if MIN_VERSION_hashable(1,4,0) +instance (Hashable v) => Container (HashSet v) where +#else instance (Eq v, Hashable v) => Container (HashSet v) where +#endif elem = HashSet.member {-# INLINE elem #-} diff --git a/src/Universum/Monad/Container.hs b/src/Universum/Monad/Container.hs index 64b89cc..355daf1 100644 --- a/src/Universum/Monad/Container.hs +++ b/src/Universum/Monad/Container.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE Trustworthy #-} {-# LANGUAGE TypeFamilies #-} @@ -18,6 +19,9 @@ import Control.Applicative (Applicative (pure)) import Data.Function ((.)) import Data.Traversable (Traversable (traverse)) import Prelude (Bool (..), Monoid, flip) +#if MIN_VERSION_base(4,17,0) +import Data.Type.Equality (type (~)) +#endif import Universum.Base (IO) import Universum.Container (Container, Element, fold, toList) diff --git a/src/Universum/String/Conversion.hs b/src/Universum/String/Conversion.hs index acf77a5..d9a3c9f 100644 --- a/src/Universum/String/Conversion.hs +++ b/src/Universum/String/Conversion.hs @@ -34,7 +34,10 @@ import Data.Function (id, (.)) import Data.Maybe (Maybe) import Data.String (String) import qualified Data.Text.Internal as T + +#if !MIN_VERSION_text(2,0,2) import qualified Data.Text.Internal.Fusion.Common as TF +#endif import Universum.Functor ((<$>)) import Universum.String.Reexport (ByteString, IsString, Read, Text, fromString) diff --git a/src/Universum/VarArg.hs b/src/Universum/VarArg.hs index 18f7cae..c9c687b 100644 --- a/src/Universum/VarArg.hs +++ b/src/Universum/VarArg.hs @@ -1,9 +1,11 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE Safe #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} -- | Provides operator of variable-arguments function composition. @@ -12,6 +14,10 @@ module Universum.VarArg ( SuperComposition(..) ) where +#if MIN_VERSION_base(4,17,0) +import Data.Type.Equality (type (~)) +#endif + -- $setup -- >>> import Universum.Base ((+)) -- >>> import Universum.Container (null) diff --git a/stack.yaml b/stack.yaml index 583ba6b..bb875e4 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1 +1 @@ -resolver: lts-19.0 +resolver: lts-21.0 diff --git a/stack.yaml.lock b/stack.yaml.lock index c3e0aa0..ad1be6c 100644 --- a/stack.yaml.lock +++ b/stack.yaml.lock @@ -6,7 +6,7 @@ packages: [] snapshots: - completed: - size: 616897 - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/19/0.yaml - sha256: bbf2be02f17940bac1f87cb462d4fb0c3355de6dcfc53d84f4f9ad3ee2164f65 - original: lts-19.0 + sha256: 1867d84255dff8c87373f5dd03e5a5cb1c10a99587e26c8793e750c54e83ffdc + size: 639139 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/21/0.yaml + original: lts-21.0 diff --git a/universum.cabal b/universum.cabal index 22c0e5f..f23e429 100644 --- a/universum.cabal +++ b/universum.cabal @@ -1,6 +1,6 @@ cabal-version: 2.2 name: universum -version: 1.8.1.1 +version: 1.8.2 synopsis: Custom prelude used in Serokell description: See README.md file for more details. homepage: https://github.com/serokell/universum @@ -13,11 +13,11 @@ category: Prelude stability: stable build-type: Simple bug-reports: https://github.com/serokell/universum/issues -tested-with: GHC == 8.6.5 - , GHC == 8.8.4 +tested-with: GHC == 8.8.4 , GHC == 8.10.7 - , GHC == 9.0.1 - , GHC == 9.2.2 + , GHC == 9.0.2 + , GHC == 9.2.8 + , GHC == 9.4.5 extra-doc-files: CHANGES.md , CONTRIBUTING.md , README.md @@ -48,6 +48,8 @@ common common-options default-language: Haskell2010 + default-extensions: TypeOperators + library import: common-options hs-source-dirs: src