barbies 2.0.3.1 → 2.0.4.0
raw patch · 4 files changed
+24/−1 lines, 4 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Data.Barbie: type family AllB (c :: k -> Constraint) b :: Constraint;
- Data.Barbie.Constraints: type family AllB (c :: k -> Constraint) b :: Constraint;
- Data.Functor.Barbie: type family AllB (c :: k -> Constraint) b :: Constraint;
- Data.Functor.Transformer: type family AllT (c :: k -> Constraint) t :: Constraint;
- Barbies.Internal: type family RepP n a :: Type -> Type;
+ Barbies.Internal: type family Zip (a :: Type -> Type) (b :: Type -> Type) :: Type -> Type
Files
- ChangeLog.md +3/−0
- barbies.cabal +1/−1
- src/Barbies/Internal/DistributiveT.hs +10/−0
- src/Barbies/Internal/FunctorT.hs +10/−0
ChangeLog.md view
@@ -1,5 +1,8 @@ # Changelog for barbies +## 2.0.4.0+ - Add FunctorT and DistributiveT instances for AccumT+ ## 2.0.3.1 - Compatibility changes for GHC 9.2 (Dan Dart)
barbies.cabal view
@@ -1,5 +1,5 @@ name: barbies-version: 2.0.3.1+version: 2.0.4.0 synopsis: Classes for working with types that can change clothes. description: Types that are parametric on a functor are like Barbies that have an outfit for each role. This package provides the basic abstractions to work with them comfortably. category: Data Structures
src/Barbies/Internal/DistributiveT.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-}@@ -19,6 +20,9 @@ import Control.Applicative.Backwards(Backwards (..)) +#if MIN_VERSION_transformers(0,5,3)+import Control.Monad.Trans.Accum(AccumT(..), runAccumT)+#endif import Control.Monad.Trans.Except(ExceptT(..), runExceptT) import Control.Monad.Trans.Identity(IdentityT(..)) import Control.Monad.Trans.Maybe(MaybeT(..))@@ -168,6 +172,12 @@ -- -- -------------------------------- -- -- Instances for transformers types -- -- --------------------------------++#if MIN_VERSION_transformers(0,5,3)+instance DistributiveT (AccumT w) where+ tdistribute fh = AccumT $ \w -> Compose $ fmap (\h -> runAccumT h w) fh+ {-# INLINE tdistribute #-}+#endif instance DistributiveT Backwards where tdistribute = Backwards . Compose . fmap forwards
src/Barbies/Internal/FunctorT.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-}@@ -15,6 +16,9 @@ import Control.Applicative.Backwards(Backwards (..)) import Control.Applicative.Lift(Lift, mapLift ) +#if MIN_VERSION_transformers(0,5,3)+import Control.Monad.Trans.Accum(AccumT, mapAccumT)+#endif import Control.Monad.Trans.Except(ExceptT, mapExceptT) import Control.Monad.Trans.Identity(IdentityT, mapIdentityT) import Control.Monad.Trans.Maybe(MaybeT, mapMaybeT)@@ -141,6 +145,12 @@ -- -------------------------------- -- Instances for transformers types -- --------------------------------++#if MIN_VERSION_transformers(0,5,3)+instance FunctorT (AccumT w) where+ tmap h = mapAccumT h+ {-# INLINE tmap #-}+#endif instance FunctorT Backwards where tmap h (Backwards fa)