packages feed

vary 0.1.1.1 → 0.1.1.2

raw patch · 8 files changed

+66/−21 lines, 8 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -8,6 +8,10 @@  ## Unreleased +## 0.1.1.2 - 2025-04-16++- Lower the minimum supported GHC version to v8.10.x by removing internal usage of `GHC2021`. ([PR #9](https://github.com/Qqwy/haskell-vary/pull/9)) Thank you, @newhoggy and @carbolymer!+ ## 0.1.1.1 - 2025-02-06  - Loosen test dependency bound on QuickCheck.
README.md view
@@ -43,8 +43,11 @@ The library is intended to be used with the following extensions active:  ```haskell top:0-{-# LANGUAGE GHC2021 #-} -- Of these, Vary uses: TypeApplications, TypeOperators, FlexibleContexts {-# LANGUAGE DataKinds #-}+-- As of GHC >= 9.2, you can replace the following three extensions by GHC2021 instead:+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE TypeApplications #-}+{-# LANGUAGE TypeOperators #-} ```  ### Simple usage
src/Vary.hs view
@@ -80,9 +80,11 @@ --  -- And for many functions, it is useful (and sometimes outright necessary) to enable the following extensions: ----- >>> -- Of the GHC2021 set, Vary uses: TypeApplications, TypeOperators, FlexibleContexts:--- >>> :set -XGHC2021  -- >>> :set -XDataKinds+-- >>> -- As of GHC >= 9.2, you can replace the following three extensions by GHC2021 instead:+-- >>> {-# LANGUAGE FlexibleContexts #-}+-- >>> {-# LANGUAGE TypeApplications #-}+-- >>> {-# LANGUAGE TypeOperators #-} -- -- Finally, some example snippets in this module make use of 'Data.Function.&', the left-to-right function application operator. --
src/Vary/Core.hs view
@@ -1,9 +1,19 @@-{-# LANGUAGE GHC2021 #-} {-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveAnyClass #-}+{-# LANGUAGE EmptyCase #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE RankNTypes #-}+{-# LANGUAGE StandaloneDeriving #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE TypeApplications #-}+{-# LANGUAGE TypeOperators #-}+{-# OPTIONS_GHC -Wno-unticked-promoted-constructors #-} {-# OPTIONS_HADDOCK not-home #-}  module Vary.Core (Vary (..), pop) where@@ -15,10 +25,10 @@ import Data.Typeable (Typeable, typeOf) import GHC.Exts (Any) import GHC.Generics-import Unsafe.Coerce qualified as Data.Coerce+import qualified Unsafe.Coerce as Data.Coerce  # ifdef FLAG_AESON-import Data.Aeson qualified as Aeson+import qualified Data.Aeson as Aeson # endif  # ifdef FLAG_HASHABLE@@ -31,15 +41,14 @@ # endif  # ifdef FLAG_BINARY-import Data.Binary qualified as Binary+import qualified Data.Binary as Binary # endif  # ifdef FLAG_CEREAL-import Data.Serialize qualified as Cereal+import qualified Data.Serialize as Cereal # endif  -- $setup--- >>> :set -XGHC2021 -- >>> :set -XDataKinds -- >>> import Vary (Vary, (:|)) -- >>> import qualified Vary
src/Vary/Utils.hs view
@@ -1,11 +1,20 @@-{-# LANGUAGE GHC2021 #-} {-# OPTIONS_GHC -Wno-redundant-constraints #-} {-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}+{-# OPTIONS_GHC -Wno-unticked-promoted-constructors #-} {-# HLINT ignore "Use camelCase" #-} -- <- We want a fun long type name with underscores for easier to read errors ;-)+{-# LANGUAGE AllowAmbiguousTypes #-}+{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DataKinds #-}-{-# LANGUAGE UndecidableInstances #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE PolyKinds #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilyDependencies #-}-{-# LANGUAGE AllowAmbiguousTypes #-}+{-# LANGUAGE TypeOperators #-}+{-# LANGUAGE UndecidableInstances #-}+ module Vary.Utils(     -- |      -- This module contains functions and typeclasses/type families (type-level functions)
src/Vary/VEither.hs view
@@ -1,10 +1,18 @@-{-# LANGUAGE GHC2021 #-}+{-# OPTIONS_GHC -Wno-unticked-promoted-constructors #-}+{-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE InstanceSigs #-} {-# LANGUAGE PatternSynonyms #-}-{-# LANGUAGE ViewPatterns #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE StandaloneDeriving #-}+{-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-}-{-# LANGUAGE CPP #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-}+{-# LANGUAGE ViewPatterns #-}+ module Vary.VEither (   -- * General Usage   -- $setup@@ -51,7 +59,7 @@ import GHC.Generics  # ifdef FLAG_AESON-import Data.Aeson qualified as Aeson+import qualified Data.Aeson as Aeson # endif  # ifdef FLAG_HASHABLE@@ -63,11 +71,11 @@ # endif  # ifdef FLAG_CEREAL-import Data.Serialize qualified as Cereal+import qualified Data.Serialize as Cereal # endif  # ifdef FLAG_BINARY-import Data.Binary qualified as Binary+import qualified Data.Binary as Binary # endif  -- $setup@@ -79,8 +87,11 @@ --  -- And for many functions, it is useful or outright necessary to enable the following extensions: ----- >>> :set -XGHC2021 -- >>> :set -XDataKinds+-- >>> -- As of GHC >= 9.2, you can replace the following three extensions by GHC2021 instead:+-- >>> {-# LANGUAGE FlexibleContexts #-}+-- >>> {-# LANGUAGE TypeApplications #-}+-- >>> {-# LANGUAGE TypeOperators #-} -- -- Finally, some example snippets in this module make use of 'Data.Function.&', the left-to-right function application operator. --@@ -148,14 +159,18 @@  -- Matches when the VEither contains one of the errors, returning @Vary errs@ pattern VLeft :: forall a errs. Vary errs -> VEither errs a+#if __GLASGOW_HASKELL__ >= 902 {-# INLINE VLeft #-}+#endif pattern VLeft errs <- (toEither -> Left errs)    where       VLeft (Vary tag err) = VEither ((Vary (tag+1) err))  -- | Matches when the VEither contains the preferred value of type @a@. pattern VRight :: forall a errs. a -> VEither errs a+#if __GLASGOW_HASKELL__ >= 902 {-# INLINE VRight #-}+#endif pattern VRight a <- (toEither -> Right a)   where     VRight a = VEither (Vary.from @a a)
test/README.lhs view
@@ -43,8 +43,11 @@ The library is intended to be used with the following extensions active:  ```haskell top:0-{-# LANGUAGE GHC2021 #-} -- Of these, Vary uses: TypeApplications, TypeOperators, FlexibleContexts {-# LANGUAGE DataKinds #-}+-- As of GHC >= 9.2, you can replace the following three extensions by GHC2021 instead:+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE TypeApplications #-}+{-# LANGUAGE TypeOperators #-} ```  ### Simple usage
vary.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack  name:           vary-version:        0.1.1.1+version:        0.1.1.2 synopsis:       Vary: Friendly and fast polymorphic variants (open unions/coproducts/extensible sums) description:    Vary: Friendly and fast Variant types for Haskell                 .