This one should be ready: <https://github.com/arro...
# arrow-contributors
j
This one should be ready: https://github.com/arrow-kt/arrow/pull/1884 It changes monad, selective and applicative laws to use actual `Gen`'s rather than just
Applicative.just
for test data. This lead to a lot of failed tests, pretty much all of them were the recently added monad-applicative-consistency laws. I've fixed those in place. Now every applicative, by default evaluates the left effect first and then the right one. That is a good standart for arrow I think. The reason these were backwards in so many cases is likely because both haskell and cats define
ap
with a different argument order than arrow (they expect the
f (A -> B)
first wheres as we expect
f a
first). As applicative has no order semantics it does not matter which it is as long as it is consistent across the entire hierarchy, which is what these laws test. For readability I think it makes sense to have
IO { println(1) }.ap(IO { { _: Unit -> println(2) } })
print 1 and then 2. (Which using only applicative methods is not guaranteed). This example with only a monad constraint would have printed 2 and then 1 before ^^ This is also the cause why
traverse
with different constraints could have caused different order on the returned collections.
arrow 1
❤️ 7