Closed frontsideair closed 7 years ago
I'm trying get accustomed to this library, which I find awesome, but I think I hit a bug.
I want to sequence an arr of maybes to a maybe of an arr but it doesn't work the way I want. Here's a test case: https://gist.github.com/frontsideair/78b42850858f58105377f09f8e0ec792
arr
maybe
I also write comparable code in Haskell, which seems to work the way I wanted:
Prelude> sequence [Just 3, Just 4, Just 5] Just [3,4,5] Prelude> sequence [Just 3, Just 4, Nothing] Nothing
The problem may not be in traversable but one of the dependencies of traversable.
traversable
Okay, that was my bad. I should've used arr.of(one_item) or arr.inj(list_of_items).
arr.of(one_item)
arr.inj(list_of_items)
I'm trying get accustomed to this library, which I find awesome, but I think I hit a bug.
I want to sequence an
arr
ofmaybe
s to amaybe
of anarr
but it doesn't work the way I want. Here's a test case: https://gist.github.com/frontsideair/78b42850858f58105377f09f8e0ec792I also write comparable code in Haskell, which seems to work the way I wanted:
The problem may not be in
traversable
but one of the dependencies oftraversable
.