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
A question that comes up a LOT in the gitter room is how to traverse a Map, our standard answer is that you can't unless you import alleycats instances or use SortedMap instead.
UnorderedFoldable and UnorderedTraverse are a very principled way of dealing with this issue, but maybe there needs to be a way to relax the strict requirement of commutativity.
I'm not exactly sure how best to address this issue, the only thing I can think of right now is to allow a traverseDontCareABoutOrdering, but that's hardly optimal either. Interested to hear more thoughts.
The text was updated successfully, but these errors were encountered:
Well I guess with a CommutativeApplicative it is okay too.
We could add a method using that and try to make sure as many as possible of the Applicative/Monad follow this.
I can see adding a method to Alleycats like traverseMap and sequenceMap which internally uses the unsafe traverse instance. This way users don’t import and unsafe instance and instead use an unsafe method at a particular call site.
A question that comes up a LOT in the gitter room is how to traverse a
Map
, our standard answer is that you can't unless you import alleycats instances or useSortedMap
instead.UnorderedFoldable and UnorderedTraverse are a very principled way of dealing with this issue, but maybe there needs to be a way to relax the strict requirement of commutativity.
I'm not exactly sure how best to address this issue, the only thing I can think of right now is to allow a
traverseDontCareABoutOrdering
, but that's hardly optimal either. Interested to hear more thoughts.The text was updated successfully, but these errors were encountered: