coercible-subtypes 0.3.0.1 → 1
raw patch · 3 files changed
+23/−15 lines, 3 filesdep −profunctorsdep ~basePVP ok
version bump matches the API change (PVP)
Dependencies removed: profunctors
Dependency ranges changed: base
API changes (from Hackage documentation)
- Data.Type.Coercion.Sub: dimapR :: (forall x x' y y'. (Coercible x x', Coercible y y') => Coercible (t x y) (t x' y'), Profunctor t) => Sub a a' -> Sub b b' -> Sub (t a' b) (t a b')
+ Data.Type.Coercion.Sub: arrowR :: (forall x x' y y'. (Coercible x x', Coercible y y') => Coercible (t x y) (t x' y'), Arrow t) => Sub a a' -> Sub b b' -> Sub (t a' b) (t a b')
Files
- CHANGELOG.md +8/−0
- coercible-subtypes.cabal +4/−4
- src/Data/Type/Coercion/Sub.hs +11/−11
CHANGELOG.md view
@@ -1,5 +1,13 @@ # Revision history for coercible-subtypes +## 1 -- 2024-12-22++* Breaking changes++ * Remove dependency to `profunctors` package. A `Profunctor`-related function `dimapR`+ is removed and replaced by `arrowR`.+ `dimapR` is moved to `coercible-subtypes-profunctor` package.+ ## 0.3.0.0 -- 2023-01-01 * Breaking changes
coercible-subtypes.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: coercible-subtypes-version: 0.3.0.1+version: 1 stability: experimental synopsis: Coercible but only in one direction description: Newtype wrapper 'Data.Type.Coercion.Sub.Sub'@@ -18,7 +18,8 @@ copyright: (c) 2020-2021 Koji Miyazato category: Data build-type: Simple-extra-source-files: CHANGELOG.md, README.md+extra-source-files: README.md+extra-doc-files: CHANGELOG.md source-repository HEAD type: git@@ -32,8 +33,7 @@ Data.Type.Coercion.Related.Internal, Newtype.Union, Newtype.Intersection- build-depends: base >=4.12 && <4.20,- profunctors+ build-depends: base >=4.12 && <4.22 hs-source-dirs: src default-language: Haskell2010 ghc-options: -Wall -Wcompat
src/Data/Type/Coercion/Sub.hs view
@@ -38,7 +38,7 @@ instantiate, mapR, contramapR,- bimapR, prodR, prod3R, sumR, dimapR, arrR+ bimapR, prodR, prod3R, sumR, arrR, arrowR ) where import Data.Coerce@@ -46,9 +46,9 @@ import Data.Bifunctor (Bifunctor) import Data.Functor.Contravariant (Contravariant)-import Data.Profunctor (Profunctor) import Data.Type.Coercion.Sub.Internal+import Control.Arrow (Arrow) -- | Make a directed witness of @'coerce' :: a -> b@. sub :: Coercible a b => Sub a b@@ -137,15 +137,15 @@ prod3R :: Sub a a' -> Sub b b' -> Sub c c' -> Sub (a,b,c) (a',b',c') prod3R (Sub Coercion) (Sub Coercion) (Sub Coercion) = Sub Coercion --- | Extend subtype relation over a 'Profunctor'.-dimapR :: ( forall x x' y y'.- (Coercible x x', Coercible y y') => Coercible (t x y) (t x' y')- , Profunctor t)- => Sub a a' -> Sub b b' -> Sub (t a' b) (t a b')-dimapR (Sub Coercion) (Sub Coercion) = Sub Coercion---- | 'dimapR' specialized for functions @(->)@+-- | 'arrowR' specialized for functions @(->)@ arrR :: Sub a a' -> Sub b b' -> Sub (a' -> b) (a -> b')-arrR = dimapR+arrR = arrowR infixr 1 `arrR`++-- | Extend subtype relation over an 'Arrow'.+arrowR :: ( forall x x' y y'.+ (Coercible x x', Coercible y y') => Coercible (t x y) (t x' y')+ , Arrow t)+ => Sub a a' -> Sub b b' -> Sub (t a' b) (t a b')+arrowR (Sub Coercion) (Sub Coercion) = Sub Coercion