red-black-record 2.0.3.0 → 2.0.4.0
raw patch · 3 files changed
+19/−5 lines, 3 filesdep ~sop-corePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: sop-core
API changes (from Hackage documentation)
+ Data.RBR.Internal: instance GHC.Base.Functor f => Data.Functor.Contravariant.Contravariant (Data.RBR.Internal.Case f a)
Files
- CHANGELOG.md +10/−0
- lib/Data/RBR/Internal.hs +4/−0
- red-black-record.cabal +5/−5
CHANGELOG.md view
@@ -1,5 +1,15 @@ # Revision history for red-black-record +## 2.0.4.0 + +- Compatibility with sop-core 0.5.0.0. +- Contravariant intance for Case newtype. + +## 2.0.3.0 + +- Issue #7: FromVariant & ToVariant instances for sum types with branches with + no arguments. + ## 2.0.2.2 - Improved compilation times for type-level deletion.
lib/Data/RBR/Internal.hs view
@@ -32,6 +32,7 @@ import Data.Kind import Data.Typeable import Data.Coerce +import Data.Functor.Contravariant (Contravariant(contramap)) import Data.Bifunctor (first) import Data.Monoid (Endo(..)) import Data.List (intersperse) @@ -702,6 +703,9 @@ {- | Represents a handler for a branch of a 'Variant'. -} newtype Case f a b = Case (f b -> a) + +instance Functor f => Contravariant (Case f a) where + contramap g (Case c) = Case (c . fmap g) {- | A form of 'addField' for creating eliminators for 'Variant's. -}
red-black-record.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.0 name: red-black-record -version: 2.0.3.0 +version: 2.0.4.0 synopsis: Extensible records and variants indexed by a type-level Red-Black tree. description: A library that provides extensible records and variants, @@ -35,14 +35,14 @@ Data.RBR.Internal Data.RBR.Examples build-depends: base >= 4.10.0.0 && < 5, - sop-core >= 0.4.0.0 && < 0.5 + sop-core >= 0.4.0.0 && < 0.6 hs-source-dirs: lib default-language: Haskell2010 library demoted exposed-modules: Data.RBR.Demoted build-depends: base >= 4.10.0.0 && < 5, - sop-core >= 0.4.0.0 && < 0.5, + sop-core >= 0.4.0.0 && < 0.6, red-black-record hs-source-dirs: lib-demoted default-language: Haskell2010 @@ -53,7 +53,7 @@ ghc-options: -threaded main-is: doctests.hs build-depends: base >= 4.10.0.0 && < 5, - sop-core >= 0.4.0.0 && < 0.5, + sop-core >= 0.4.0.0 && < 0.6, red-black-record, aeson >= 1.4.0.0 && < 1.5, bytestring >= 0.10, @@ -68,7 +68,7 @@ main-is: tests.hs build-depends: base >= 4.10.0.0 && < 5, - sop-core >= 0.4.0.0 && < 0.5, + sop-core >= 0.4.0.0 && < 0.6, tasty >= 0.10.1.1, tasty-hunit >= 0.9.2, red-black-record,