kan-extensions 5.2.6 → 5.2.7
raw patch · 5 files changed
+17/−11 lines, 5 files
Files
- CHANGELOG.markdown +5/−0
- kan-extensions.cabal +8/−5
- src/Data/Functor/Contravariant/Day.hs +0/−3
- src/Data/Functor/Day.hs +0/−3
- src/Data/Functor/Yoneda.hs +4/−0
CHANGELOG.markdown view
@@ -1,3 +1,8 @@+5.2.7 [2025.06.17]+------------------+* Make the implementations of `(.>)` and `(*>)` for `Data.Functor.Yoneda` more+ stack-efficient.+ 5.2.6 [2024.05.04] ------------------ * Drop support for GHC 8.2 and earlier.
kan-extensions.cabal view
@@ -1,6 +1,6 @@ name: kan-extensions category: Data Structures, Monads, Comonads, Functors-version: 5.2.6+version: 5.2.7 license: BSD3 cabal-version: >= 1.10 license-file: LICENSE@@ -19,8 +19,11 @@ , GHC == 8.10.7 , GHC == 9.0.2 , GHC == 9.2.8- , GHC == 9.4.5- , GHC == 9.6.2+ , GHC == 9.4.8+ , GHC == 9.6.6+ , GHC == 9.8.4+ , GHC == 9.10.1+ , GHC == 9.12.1 extra-source-files: .gitignore@@ -30,7 +33,7 @@ source-repository head type: git- location: git://github.com/ekmett/kan-extensions.git+ location: https://github.com/ekmett/kan-extensions.git library hs-source-dirs: src@@ -50,7 +53,7 @@ array >= 0.3.0.2 && < 0.6, base >= 4.11 && < 5, comonad >= 4 && < 6,- containers >= 0.4 && < 0.8,+ containers >= 0.4 && < 0.9, contravariant >= 1 && < 2, distributive >= 0.2.2 && < 1, invariant >= 0.1 && < 1,
src/Data/Functor/Contravariant/Day.hs view
@@ -3,7 +3,6 @@ {-# LANGUAGE Rank2Types #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE UndecidableInstances #-}-{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE KindSignatures #-} ----------------------------------------------------------------------------- -- |@@ -39,11 +38,9 @@ import Data.Functor.Contravariant.Divisible import Data.Proxy import Data.Tuple (swap)-import Data.Typeable -- | The Day convolution of two contravariant functors. data Day f g a = forall b c. Day (f b) (g c) (a -> (b, c))- deriving Typeable -- | Construct the Day convolution --
src/Data/Functor/Day.hs view
@@ -1,7 +1,6 @@ {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE KindSignatures #-}-{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE UndecidableInstances #-}@@ -49,12 +48,10 @@ import Data.Functor.Adjunction import Data.Functor.Identity import Data.Functor.Rep-import Data.Typeable import Prelude hiding (id,(.)) -- | The Day convolution of two covariant functors. data Day f g a = forall b c. Day (f b) (g c) (b -> c -> a)- deriving Typeable -- | Construct the Day convolution day :: f (a -> b) -> g a -> Day f g b
src/Data/Functor/Yoneda.hs view
@@ -113,12 +113,16 @@ instance Apply f => Apply (Yoneda f) where Yoneda m <.> Yoneda n = Yoneda (\f -> m (f .) <.> n id) {-# INLINE (<.>) #-}+ Yoneda m .> Yoneda n = Yoneda (\f -> m id .> n f)+ {-# INLINE (.>) #-} instance Applicative f => Applicative (Yoneda f) where pure a = Yoneda (\f -> pure (f a)) {-# INLINE pure #-} Yoneda m <*> Yoneda n = Yoneda (\f -> m (f .) <*> n id) {-# INLINE (<*>) #-}+ Yoneda m *> Yoneda n = Yoneda (\f -> m id *> n f)+ {-# INLINE (*>) #-} instance Foldable f => Foldable (Yoneda f) where foldMap f = foldMap f . lowerYoneda