Hey, in arrow the traverse method from the Traversable typeclass is usually (for collections) implemented using foldRight, but haskell's docs at http://hackage.haskell.org/package/base-4.12.0.0/docs/Data-Traversable.html state that travers is left to right. Is that a bug or a conscious decision? I am for changing that, because for infinite structures like sequence traverse would never compute anything and spend all its time forcing the sequence, whereas with a left to right manner it would actually compute stuff (and when used with IO can also abort whenever it wants)
Jannis
10/26/2019, 9:49 AM
This bad, albeit perfectly fine code will fail with traverse, but work just fine in haskell, that is due to lazyness. I believe this can be recreated using Eval and Option composed but that is very very ugly to do by hand, so maybe offer a short hand method?
Jannis
10/26/2019, 9:51 AM
Oh and ignore the custom applicative instance, I was writing this inside arrow-core-data where that does not exist, just ignore it mentally.
Jannis
10/26/2019, 9:54 AM
Also ignore what I said about maybe fixing this with eval, it can't be done, it needs to be fixed inside traverse.