Closed jfet97 closed 4 years ago
It's a different bimap. The first one is for BiComp bf fu gu
the last one is for bf
. These different implementations are not marked by the name fo the bifuncor, because GHC figures that out. Maybe a subscript bimap_{bf} would help?
Uh, I've completely misunderstood the sentence "The outer bimap
breaks through the outer bf
layer", most likely because English is not my mother tongue.
Anyway shame on me because I should have thought that you weren't talking about the Bicomp
's bimap
. Now taking a closer look, I see that it's the bf
's bimap
type signature š
Obviously, in my case, a subscript bimap_{bf} would have been very helpful, but honestly, I'm in no position to suggest anything š š š
Not sure about that, maybe I've misunderstood something but...
This is the
BiComp
Bifunctor presented at page 120So
f1
andf2
are "normal" functions that are mapped firstly by the Functorsfu
andgu
respectively, then are mapped together by the Bifunctorbf
. As expected,f1
andf2
are presented in this way at page 121:Therefore, the expected signature for the
bimap
function of theBiComp
Bifunctor shouldn't be:(a -> a') -> (b -> b') -> bf (fu a) (gu b) -> bf (fu a') (gu b')
? Corresponding to the given definition ofbimap
that is:f1 -> f2 -> BiComp x -> ...
I'm asking because it is presented differently at page 121:
(fu a -> fu a') -> (fu b -> fu b') -> bf (fu a) (gu b) -> bf (fu a') (gu b')