packages feed

these-optics 1 → 1.0.1

raw patch · 3 files changed

+25/−8 lines, 3 filesdep ~base

Dependency ranges changed: base

Files

CHANGELOG.md view
@@ -1,3 +1,7 @@+# 1.0.1++- Add `Each These` instance+ # 1  Split out of `these` package.
src/Data/These/Optics.hs view
@@ -1,4 +1,8 @@-{-# LANGUAGE Trustworthy #-}+{-# LANGUAGE FlexibleInstances     #-}+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE Trustworthy           #-}+{-# LANGUAGE TypeFamilies          #-}+{-# LANGUAGE UndecidableInstances  #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Data.These.Optics (     -- * Affine traversals@@ -11,7 +15,8 @@ import Data.These import Data.These.Combinators (swapThese) import Optics.Core-       (AffineTraversal, Prism', Swapped (..), atraversalVL, iso, prism)+       (AffineTraversal, Each (..), Prism', Swapped (..), atraversalVL, iso,+       itraversalVL, prism)  -- $setup -- >>> import Optics.Core@@ -76,3 +81,10 @@  instance Swapped These where     swapped = iso swapThese swapThese++-- | @since 1.0.1+instance (a ~ a', b ~ b') => Each (Either () ()) (These a a') (These b b') a b where+    each = itraversalVL aux where+        aux f (This a)    = This <$> f (Left ()) a+        aux f (That b)    = This <$> f (Right ()) b+        aux f (These a b) = These <$> f (Left ()) a <*> f (Right ()) b
these-optics.cabal view
@@ -1,6 +1,6 @@ cabal-version:      >=1.10 name:               these-optics-version:            1+version:            1.0.1 synopsis:           Optics for These homepage:           https://github.com/isomorphism/these license:            BSD3@@ -11,7 +11,9 @@ build-type:         Simple extra-source-files: CHANGELOG.md description:        This package provides Prism and Traversals for @These@.-tested-with:        GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.1+tested-with:+    GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.3 || ==8.10.1+  , GHCJS ==8.4  source-repository head   type:     git@@ -28,11 +30,10 @@   exposed-modules:  Data.These.Optics    -- ghc boot libs-  build-depends:    base >=4.9 && <4.13+  build-depends:    base >=4.9 && <4.15    -- these-  build-depends:    these >=1 && <1.1+  build-depends:    these >=1 && <1.2    -- other dependencies-  build-depends:-    optics-core      >=0.1    && <0.2+  build-depends:    optics-core >=0.1 && <0.4