Probably a very naive question, but I can't find a...
# arrow
m
Probably a very naive question, but I can't find an easy solution for: What's the most concise way of turning a
List<Option<A>>
into a
Option<List<A>>
? So if any if the `Option`s in the original List is
None
, the whole return type should be
None
.
p
List<Option<A>>.sequence(Option.applicative())
will return a
Option<List<A>>
or rather
Kind<ForOption,Kind<ForListK,A>>
so you'll have to
fix()
output.
m
sequence
! Thanks! Could not remember from my Haskell days ...