packages feed

assoc 1.0.2 → 1.1.1

raw patch · 4 files changed

Files

CHANGELOG.md view
@@ -1,3 +1,14 @@+## 1.1.1++- Drop support for GHC prior GHC-8.6.5++## 1.1++- Depend on `bifunctor-classes-compat` only.+  Instances for types defined in `bifunctors` package are moved there.+  With this change `assoc` only depends on `base` and `tagged`.+- Mark modules as explicitly Safe+ ## 1.0.2  - Add 'Swap' instances for more n-tuples
assoc.cabal view
@@ -1,7 +1,7 @@-cabal-version:      1.12+cabal-version:      3.0 name:               assoc-version:            1.0.2-license:            BSD3+version:            1.1.1+license:            BSD-3-Clause license-file:       LICENSE synopsis:           swap and assoc: Symmetric and Semigroupy Bifunctors category:           Data@@ -17,31 +17,35 @@ build-type:         Simple extra-source-files: CHANGELOG.md tested-with:-    GHC ==7.0.4-     || ==7.2.2-     || ==7.4.2-     || ==7.6.3-     || ==7.8.4-     || ==7.10.3-     || ==8.0.2-     || ==8.2.2-     || ==8.4.4-     || ==8.6.5-     || ==8.8.3-     || ==8.10.1-  , GHCJS ==8.4+    GHC ==8.6.5+     || ==8.8.4+     || ==8.10.7+     || ==9.0.2+     || ==9.2.8+     || ==9.4.8+     || ==9.6.5+     || ==9.8.2+     || ==9.10.1  source-repository head   type:     git   location: https://github.com/phadej/assoc.git +flag tagged+  default:     False+  manual:      True+  description:+    You can disable the use of the `tagged` package using `-f-tagged`.+    .+    Disabing this is an unsupported configuration, but it may be useful for accelerating builds in sandboxes for expert users.+ library   default-language: Haskell2010   hs-source-dirs:   src-  build-depends:-      base        >=4.3   && <4.15-    , bifunctors  >=5.5.5 && <5.6-    , tagged      >=0.8.6 && <0.9+  build-depends:    base >=4.12 && <4.21++  if flag(tagged)+    build-depends: tagged >=0.8.8 && <0.9    exposed-modules:     Data.Bifunctor.Assoc
src/Data/Bifunctor/Assoc.hs view
@@ -1,14 +1,20 @@+{-# LANGUAGE CPP #-}+#if __GLASGOW_HASKELL__ >=704+{-# LANGUAGE Safe #-}+#elif __GLASGOW_HASKELL__ >=702+{-# LANGUAGE Trustworthy #-}+#endif module Data.Bifunctor.Assoc (     Assoc (..),     ) where -import Control.Applicative    (Const (..))-import Data.Bifunctor         (Bifunctor (..))-import Data.Bifunctor.Flip    (Flip (..))-import Data.Bifunctor.Product (Product (..))-import Data.Bifunctor.Tannen  (Tannen (..))-import Data.Tagged            (Tagged (..))+import Control.Applicative (Const (..))+import Data.Bifunctor      (Bifunctor (..)) +#ifdef MIN_VERSION_tagged+import Data.Tagged         (Tagged (..))+#endif+ -- | "Semigroup-y" 'Bifunctor's. -- -- @@@ -41,13 +47,11 @@     assoc (Const (Const a)) = Const a     unassoc (Const a) = Const (Const a) +#ifdef MIN_VERSION_tagged instance Assoc Tagged where     assoc (Tagged a) = Tagged (Tagged a)     unassoc (Tagged (Tagged a)) = Tagged a--instance Assoc p => Assoc (Flip p) where-    assoc   = Flip . first Flip . unassoc . second runFlip . runFlip-    unassoc = Flip . second Flip . assoc . first runFlip . runFlip+#endif  -- $setup --
src/Data/Bifunctor/Swap.hs view
@@ -1,14 +1,15 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE TypeFamilies #-}+#if __GLASGOW_HASKELL__ >=704+{-# LANGUAGE Safe #-}+#elif __GLASGOW_HASKELL__ >=702+{-# LANGUAGE Trustworthy #-}+#endif module Data.Bifunctor.Swap (     Swap (..),     ) where -import Data.Bifunctor         (Bifunctor (..))-import Data.Bifunctor.Biff    (Biff (..))-import Data.Bifunctor.Flip    (Flip (..))-import Data.Bifunctor.Product (Product (..))-import Data.Bifunctor.Sum     (Sum (..))-import Data.Bifunctor.Tannen  (Tannen (..))+import Data.Bifunctor (Bifunctor (..))  import qualified Data.Tuple @@ -41,22 +42,6 @@ instance Swap Either where     swap (Left x) = Right x     swap (Right x) = Left x--instance Swap p => Swap (Flip p) where-    swap = Flip . swap . runFlip--instance (Swap p, Swap q) => Swap (Product p q) where-    swap (Pair p q) = Pair (swap p) (swap q)--instance (Swap p, Swap q) => Swap (Sum p q) where-    swap (L2 p) = L2 (swap p)-    swap (R2 q) = R2 (swap q)--instance (Functor f, Swap p) => Swap (Tannen f p) where-    swap = Tannen . fmap swap . runTannen--instance (f ~ g, Functor f, Swap p) => Swap (Biff p f g) where-    swap = Biff . swap . runBiff  instance Swap ((,,) x) where     swap (x,a,b) = (x,b,a)