packages feed

strict-lens 0.4.0.2 → 0.4.0.3

raw patch · 2 files changed

+11/−75 lines, 2 filesdep ~basedep ~lensdep ~strictPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base, lens, strict

API changes (from Hackage documentation)

Files

src/Data/Strict/Lens.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE CPP                   #-} {-# LANGUAGE DeriveDataTypeable    #-} {-# LANGUAGE DeriveGeneric         #-} {-# LANGUAGE FlexibleInstances     #-}@@ -6,8 +5,6 @@ {-# LANGUAGE StandaloneDeriving    #-} {-# LANGUAGE TypeFamilies          #-} {-# LANGUAGE UndecidableInstances  #-}--{-# OPTIONS_GHC -fno-warn-orphans #-} module Data.Strict.Lens (     -- * Tuple     -- | See instances, in particular for 'Field1' and 'Field2' type classes.@@ -33,36 +30,10 @@ import           Data.Strict         (Either (..), Maybe (..), Pair (..),                                       These (..), either, maybe, these) -#if !MIN_VERSION_lens(5,0,0)-import           Control.Applicative ((<*>))-import           Control.Lens        (Each (..), Field1 (..), Field2 (..),-                                      Swapped (..), indexed, iso, (<&>))-import qualified Control.Lens        as L-import           Data.Strict         (Strict (..), swap)-#endif- ------------------------------------------------------------------------------- -- Tuple ------------------------------------------------------------------------------- -#if !MIN_VERSION_lens(5,0,0)-instance Field1 (Pair a b) (Pair a' b) a a' where-  _1 k (a :!: b) = indexed k (0 :: Int) a <&> \a' -> (a' :!: b)--instance Field2 (Pair a b) (Pair a b') b b' where-  _2 k (a :!: b) = indexed k (1 :: Int) b <&> \b' -> (a :!: b')--instance L.Strict (a, b) (Pair a b) where-  strict = iso toStrict toLazy--instance Swapped Pair where-  swapped = iso swap swap--instance (a~a', b~b') => Each (Pair a a') (Pair b b') a b where-  each f ~(a :!: b) = (:!:) <$> f a <*> f b-  {-# INLINE each #-}-#endif- -- TODO: this should be removed. Probably. type instance Index (Pair a b) = Int @@ -70,18 +41,6 @@ -- Either ------------------------------------------------------------------------------- -#if !MIN_VERSION_lens(5,0,0)-instance L.Strict (L.Either a b) (Either a b) where-  strict = iso toStrict toLazy--instance Swapped Either where-  swapped = either Right Left `iso` either Right Left--instance (a ~ a', b ~ b') => Each (Either a a') (Either b b') a b where-  each f (Left x)  = Left <$> f x-  each f (Right x) = Right <$> f x-#endif- -- | Analogous to 'Control.Lens.Prism._Left' in "Control.Lens.Prism". _Left :: Prism (Either a c) (Either b c) a b _Left = prism Left $ either L.Right (L.Left . Right)@@ -94,13 +53,6 @@ -- Maybe ------------------------------------------------------------------------------- -#if !MIN_VERSION_lens(5,0,0)-instance L.Strict (L.Maybe a) (Maybe a) where-  strict = iso toStrict toLazy--instance Each (Maybe a) (Maybe b) a b-#endif- -- | Analogous to 'Control.Lens.Prism._Just' in "Control.Lens.Prism" _Just :: Prism (Maybe a) (Maybe b) a b _Just = prism Just $ maybe (L.Left Nothing) L.Right@@ -112,21 +64,6 @@ ------------------------------------------------------------------------------- -- These ---------------------------------------------------------------------------------#if !MIN_VERSION_lens(5,0,0)-instance Swapped These where-    swapped = iso swapThese swapThese--swapThese :: These a b -> These b a-swapThese (This a)    = That a-swapThese (That b)    = This b-swapThese (These a b) = These b a--instance (a ~ a', b ~ b') => Each (These a a') (These b b') a b where-    each f (This a)    = This <$> f a-    each f (That b)    = That <$> f b-    each f (These a b) = These <$> f a <*> f b-#endif  -- | A 'Control.Lens.Traversal' of the first half of a 'These', suitable for use with "Control.Lens". --
strict-lens.cabal view
@@ -1,5 +1,5 @@ name:               strict-lens-version:            0.4.0.2+version:            0.4.0.3 synopsis:           Lenses for types in strict package category:           Data, Lenses description:        Lenses for types in strict package.@@ -18,17 +18,16 @@ cabal-version:      >=1.10 build-type:         Simple tested-with:-  GHC ==7.4.2-   || ==7.6.3-   || ==7.8.4-   || ==7.10.3-   || ==8.0.2+  GHC ==8.0.2    || ==8.2.2    || ==8.4.4    || ==8.6.5-   || ==8.8.3-   || ==8.10.1-   || ==9.0.1+   || ==8.8.4+   || ==8.10.7+   || ==9.0.2+   || ==9.2.7+   || ==9.4.4+   || ==9.6.1  extra-source-files: CHANGES.md @@ -47,9 +46,9 @@       -Wnoncanonical-monadfail-instances    build-depends:-      base    >=4.5    && <5-    , lens    >=4.19.2 && <5.1-    , strict  >=0.4    && <0.4.1+      base    >=4.9   && <5+    , lens    >=5.2.1 && <5.3+    , strict  >=0.5   && <0.6    hs-source-dirs:   src   exposed-modules:  Data.Strict.Lens