Closed MazeChaZer closed 5 years ago
Version: v1.2.1
So in chapter 8.3 “Functorial Algebraic Data Types” the type signature of bimap in the instance of BiComp bf fu gu is given as
bimap
BiComp bf fu gu
bimap :: (fu a -> fu a') -> (gu b -> gu b') -> bf (fu a) (gu b) -> bf (fu a') (gu b')
I might be very well mistaken, but shouldn't that signature be like this?
bimap :: (a -> a') -> (b -> b') -> bf (fu a) (gu b) -> bf (fu a') (gu b')
Especially because f1 and f2 are defined with exactly these signatures, a -> a' and b -> b' a few lines above.
f1
f2
a -> a'
b -> b'
Looking at the definition of the type class Bifunctor leads me to the same conclusion:
Bifunctor
class Bifunctor (p :: * -> * -> *) where bimap :: (a -> b) -> (c -> d) -> p a c -> p b d
Thanks in advance for your feedback and sorry if I got confused and mixed things up :see_no_evil:
Nevermind me, I think the given type signature for bimap was meant to be for the type bf, not BiComp, closing.
bf
BiComp
Version: v1.2.1
So in chapter 8.3 “Functorial Algebraic Data Types” the type signature of
bimap
in the instance ofBiComp bf fu gu
is given asI might be very well mistaken, but shouldn't that signature be like this?
Especially because
f1
andf2
are defined with exactly these signatures,a -> a'
andb -> b'
a few lines above.Looking at the definition of the type class
Bifunctor
leads me to the same conclusion:Thanks in advance for your feedback and sorry if I got confused and mixed things up :see_no_evil: