Closed Icelandjack closed 4 years ago
I agree that giving Co
a Functor
instance that doesn't use fmapRep
is strange and inconsistent with its other class instances. I'd happily accept a pull request which changed this state of affairs.
There is the pull request.
From :info
we already see that Functor
is an odd one out from its non Representable
context. It still wouldn't hurt to show show which strategy if any an instance was derived from :classify
,
>> :classify Co
stock:
instance Functor f => Functor (Co f)
standalone:
instance Representable f => Applicative (Co f)
Hi (not using the bleeding edge), let's say I have
Let's say I want to derive some instances
via
Co Pair
Spot the mistake?
Because the
Functor (Co f)
instance is stock derived it's the only instance that doesn't make use ofRepresentable
and depends onf
being a functor alreadyThis doesn't trigger an error? Maybe I'm doing it wrong. In any case this means that we trigger a cyclic definition
fmap = fmap
.I propose the following definition, which is in line with all other instances