Closed Icelandjack closed 6 years ago
Any Alternative
functor f
must have an empty shape to provide an f a
for any a
. Representable
functors only have one shape, so an Alternative
Representable
functor must be isomorphic to Void
. So at least that instance is not very interesting.
Good observation (it was a pleasure meeting you at Haskell eXchange @sjoerdvisscher)
Other instances may be mildly interesting but should really be derived through DerivingVia
rather than fixing them as an instance.
newtype M33 a = M33 (V3 (V3 a))
deriving
(Generic, Generic1)
deriving (Comonad, ...)
via (Compose V3 V3 `STEALING` Day V3 V3)
I think I will close this ticket
There is an isomorphism between
Compose f g
andDay f g
of representable functorsThis means every instance of
Compose f g
is a potential instance forDay
, would these instances be useful and worth adding?This allows for an
Alternative
definition as well as an inordinate number of other instances.We also get a handful of classes the other way: some instance for
Compose f g
that work for functors likeCoyoneda f
,(_ ->)
,Cofree
,Day
and recursivelyCompose
(it would be an orphan instance I suppose)