From 7f2bf7a9d51e6f30c4620ec2d7cb850520345eb6 Mon Sep 17 00:00:00 2001 From: mniip Date: Sat, 22 Jun 2024 19:26:20 +0200 Subject: [PATCH] Update documentation regarding arrow instances --- CHANGELOG.markdown | 31 ++++++++++++++++++++++++++++++- src/Data/Profunctor/Types.hs | 7 +++---- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.markdown b/CHANGELOG.markdown index e4e4f6f6..45dc9d8e 100644 --- a/CHANGELOG.markdown +++ b/CHANGELOG.markdown @@ -12,7 +12,36 @@ * Re-export Data.Bifunctor.Functor's (:->) rather than supply our own so the two definitions do not conflict. * Added fixpoints of ProfunctorFunctors. -* Add `instance Monoid r => Applicative (Forget r a)`. +* Added `instance Monoid r => Applicative (Forget r a)`. +* Added a number of (co)strength instances: + * `MonadFix f => Costrong (Star f)` + * `Strong p => Strong (TambaraSum p)` + * `Costrong p => Costrong (TambaraSum p)` + * `Strong p => Strong (PastroSum p)` + * `(Strong p, Costrong q) => Costrong (Rift p q)` + * `(Choice p, Cochoice q) => Cochoice (Rift p q)` + * `(Strong p, Costrong q) => Costrong (Ran p q)` + * `(Choice p, Cochoice q) => Cochoice (Ran p q)` + * `(Strong p, Costrong p) => Costrong (Codensity p)` + * `(Choice p, Cochoice p) => Cochoice (Codensity p)` + * `(Profunctor p, Strong q) => Strong (Day p q)` + * `(Choice p, Choice q) => Choice (Day p q)` +* Added `Arrow`, `ArrowChoice`, and `ArrowLoop` instances to all types that have appropriate (co)strength. +* Added `ArrowPlus p => ArrowPlus (WrappedArrow p)` +* Added other arrow isntances: + * `MonadPlus f => ArrowZero (Star f)` + * `MonadPlus f => ArrowPlus (Star f)` + * `Monad f => ArrowApply (Star f)` + * `(ArrowZero p, Profunctor p) => ArrowZero (CofreeTraversing p)` + * `(ArrowPlus p, Profunctor p) => ArrowPlus (CofreeTraversing p)` + * `ArrowZero p => ArrowZero (TambaraSum p)` + * `ArrowPlus p => ArrowPlus (TambaraSum p)` + * `(ArrowZero p, Profunctor p) => ArrowZero (Yoneda p)` + * `(ArrowPlus p, Profunctor p) => ArrowPlus (Yoneda p)` + * `(ArrowApply p, Profunctor p) => ArrowApply (Yoneda p)` + * `(ArrowZero p, Profunctor p) => ArrowZero (Coyoneda p)` + * `(ArrowPlus p, Profunctor p) => ArrowPlus (Coyoneda p)` + * `(ArrowApply p, Profunctor p) => ArrowApply (Coyoneda p)` 5.6.2 [2021.02.17] ------------------ diff --git a/src/Data/Profunctor/Types.hs b/src/Data/Profunctor/Types.hs index 7a21c869..44676b8f 100644 --- a/src/Data/Profunctor/Types.hs +++ b/src/Data/Profunctor/Types.hs @@ -181,7 +181,9 @@ instance Comonad f => Category (Costar f) where -- Wrapped Profunctors ------------------------------------------------------------------------------ --- | +-- | This newtype allows 'Profunctor' classes to be used with types that only +-- implement @base@'s arrow classes. +-- -- - 'Arrow' is equivalent to 'Category' -- && t'Data.Profunctor.Strong.Strong'. -- - 'ArrowChoice' is equivalent to 'Category' @@ -189,9 +191,6 @@ instance Comonad f => Category (Costar f) where -- - 'ArrowLoop' is equivalent to 'Category' -- && t'Data.Profunctor.Strong.Strong' && t'Data.Profunctor.Strong.Costrong'. -- --- This newtype allows 'Profunctor' classes to be used with types that only --- implement @base@'s arrow classes. --- -- 'WrappedArrow' has a polymorphic kind since @5.6@. -- WrappedArrow :: (k1 -> k2 -> Type) -> (k1 -> k2 -> Type)