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
Something that's Traversing should perhaps be, in addition to being Strong and Choice, also something that represents being able to go over a fixed number of values. If there were some kind of numbered Vec, I could see it going something like this:
The other way I could see it happening is by using the fact that a Distributive always has the same number of values in it, because it's isomorphic to x -> a for some x:
I honestly have no idea how to convert the former to the latter, though, or what to do if the f to be traversed is infinite, because infinite traversals in Haskell can be meaningful. I'm also not entirely sure how a hypothetical wander analogue of traverseFixed would go, since the point of Applicative is that it can combine an arbitrary number of fixed effects.
The text was updated successfully, but these errors were encountered:
Distributive is alone is not enough. The r in (->) r ~ f must be ordered. In Vec n case r ~ Fin n, and has Enum, Bounded instances which agree with Traversable (Vec n). But in general, i.e. with just Distributive.
I think you try to generalise binary-product into "finite products". Maybe (Traversable f, Distributive f) is a way to say that, but I'm not sure.
Something that's
Traversing
should perhaps be, in addition to beingStrong
andChoice
, also something that represents being able to go over a fixed number of values. If there were some kind of numberedVec
, I could see it going something like this:The other way I could see it happening is by using the fact that a
Distributive
always has the same number of values in it, because it's isomorphic tox -> a
for somex
:I honestly have no idea how to convert the former to the latter, though, or what to do if the
f
to be traversed is infinite, because infinite traversals in Haskell can be meaningful. I'm also not entirely sure how a hypotheticalwander
analogue oftraverseFixed
would go, since the point ofApplicative
is that it can combine an arbitrary number of fixed effects.The text was updated successfully, but these errors were encountered: