You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can construct the free Divisible functor (free relative to the forgetful functor which only remembers the Contravariant instance) using contravariant Day convolution, just like you can construct the free Applicative using covariant Day convolution:
-- Free f ~ Coproduct Proxy (Day f (Free f))dataFreefa=Conquer
| forallbc.Divide (a-> (b, c)) (fb) (Freefc)
So you can list out the primitive ways you would like to be able to consume values using some Contravariant functor, and then construct a Divisible functor from that. To consume an a using Free f a, you split a into a big tuple, and for each component of that tuple, either consume it using an f, or simply use conquer.
Maybe it's worth adding here?
I have a prototype implementation in PureScript here for reference.
The text was updated successfully, but these errors were encountered:
You can construct the free
Divisible
functor (free relative to the forgetful functor which only remembers theContravariant
instance) using contravariantDay
convolution, just like you can construct the freeApplicative
using covariantDay
convolution:So you can list out the primitive ways you would like to be able to consume values using some
Contravariant
functor, and then construct aDivisible
functor from that. To consume ana
usingFree f a
, you splita
into a big tuple, and for each component of that tuple, either consume it using anf
, or simply useconquer
.Maybe it's worth adding here?
I have a prototype implementation in PureScript here for reference.
The text was updated successfully, but these errors were encountered: