packages feed

kan-extensions 4.2 → 4.2.1

raw patch · 3 files changed

+34/−2 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Data.Functor.Kan.Rift: liftRift :: Applicative f => f a -> Rift f f a
+ Data.Functor.Kan.Rift: lowerRift :: Applicative f => Rift f g a -> g a

Files

CHANGELOG.markdown view
@@ -1,3 +1,11 @@+4.2.1+---+* Add `liftRift` and `lowerRift`++4.2+---+* Remove pointed dependency+ 4.1.1 --- * Added `Applicative` instance for `Day`
kan-extensions.cabal view
@@ -1,6 +1,6 @@ name:          kan-extensions category:      Data Structures, Monads, Comonads, Functors-version:       4.2+version:       4.2.1 license:       BSD3 cabal-version: >= 1.6 license-file:  LICENSE
src/Data/Functor/Kan/Rift.hs view
@@ -26,7 +26,7 @@   , composeRift, decomposeRift   , adjointToRift, riftToAdjoint   , composedAdjointToRift, riftToComposedAdjoint-  , rap+  , liftRift, lowerRift, rap   ) where  import Control.Applicative@@ -110,6 +110,30 @@   {-# INLINE pure #-}   Rift mf <*> Rift ma = Rift (ma . mf . fmap (.))   {-# INLINE (<*>) #-}++-- | The natural isomorphism between @f@ and @Rift f f@.+-- @+-- 'lowerRift' '.' 'liftRift' ≡ 'id'+-- 'liftRift' '.' 'lowerRift' ≡ 'id'+-- @+--+-- @+-- 'lowerRift' ('liftRift' x)     -- definition+-- 'lowerRift' ('Rift' ('<*>' x))   -- definition+-- ('<*>' x) ('pure' 'id')          -- beta reduction+-- 'pure' 'id' '<*>' x              -- Applicative identity law+-- x+-- @+liftRift :: Applicative f => f a -> Rift f f a+liftRift fa = Rift (<*> fa)+{-# INLINE liftRift #-}++-- | Lower 'Rift' by applying 'pure' 'id' to the continuation.+--+-- See 'liftRift'.+lowerRift :: Applicative f => Rift f g a -> g a+lowerRift (Rift f) = f (pure id)+{-# INLINE lowerRift #-}  -- | Indexed applicative composition of right Kan lifts. rap :: Functor f => Rift f g (a -> b) -> Rift g h a -> Rift f h b