packages feed

kan-extensions 4.1.1 → 4.2

raw patch · 4 files changed

+7/−12 lines, 4 filesdep −pointedPVP ok

version bump matches the API change (PVP)

Dependencies removed: pointed

API changes (from Hackage documentation)

- Data.Functor.Kan.Lift: instance (Functor g, g ~ h) => Copointed (Lift g h)
- Data.Functor.Kan.Rift: instance (Functor g, g ~ h) => Pointed (Rift g h)
+ Control.Monad.Codensity: instance MonadReader r m => MonadReader r (Codensity m)

Files

kan-extensions.cabal view
@@ -1,6 +1,6 @@ name:          kan-extensions category:      Data Structures, Monads, Comonads, Functors-version:       4.1.1+version:       4.2 license:       BSD3 cabal-version: >= 1.6 license-file:  LICENSE@@ -49,7 +49,6 @@     distributive  >= 0.2.2   && < 1,     free          >= 4       && < 5,     mtl           >= 2.0.1   && < 2.3,-    pointed       >= 4       && < 5,     semigroupoids >= 4       && < 5,     tagged        >= 0.7.2   && < 1,     transformers  >= 0.2     && < 0.5
src/Control/Monad/Codensity.hs view
@@ -206,6 +206,12 @@   put s = Codensity (\k -> local (const s) (k ()))   {-# INLINE put #-} +instance MonadReader r m => MonadReader r (Codensity m) where+  ask = Codensity (ask >>=)+  {-# INLINE ask #-}+  local f m = Codensity $ \c -> ask >>= \r -> local f . runCodensity m $ local (const r) . c+  {-# INLINE local #-}+ -- | Right associate all binds in a computation that generates a free monad -- -- This can improve the asymptotic efficiency of the result, while preserving
src/Data/Functor/Kan/Lift.hs view
@@ -30,7 +30,6 @@   , liftToComposedRep, composedRepToLift   ) where -import Data.Copointed import Data.Functor.Adjunction import Data.Functor.Composition import Data.Functor.Compose@@ -49,10 +48,6 @@ instance Functor (Lift g h) where   fmap f (Lift g) = Lift (\x -> fmap f (g x))   {-# INLINE fmap #-}--instance (Functor g, g ~ h) => Copointed (Lift g h) where-  copoint x = runIdentity (runLift x (fmap Identity))-  {-# INLINE copoint #-}  -- | --
src/Data/Functor/Kan/Rift.hs view
@@ -33,7 +33,6 @@ import Data.Functor.Adjunction import Data.Functor.Composition import Data.Functor.Identity-import Data.Pointed  -- * Right Kan Lift @@ -105,10 +104,6 @@ instance Functor g => Functor (Rift g h) where   fmap f (Rift g) = Rift (g . fmap (.f))   {-# INLINE fmap #-}--instance (Functor g, g ~ h) => Pointed (Rift g h) where-  point a = Rift (fmap ($a))-  {-# INLINE point #-}  instance (Functor g, g ~ h) => Applicative (Rift g h) where   pure a = Rift (fmap ($a))