cvogt/flow-comprehensions

rename sequence

Opened this issue · 1 comments

cvogt commented

the common Monad.sequence has well defined semantics among others not being sequential. The comprehension currently called sequence in here is sequential, so we should probably rename it. How about comprehension or for2or forseq or flat (flat like flatMap), e.g.

flat[Future]{
  ~someFuture + ~otherFuture
}
cvogt commented

More proposals:

implicit class FutureComprehension(f: Future.type){
  def flat = sequence[Future]
  // or
  def comprehension = sequence[Future]
}

Future.flat{
  ~someFuture + ~otherFuture
}

//or

Future.comprehension{
  ~someFuture + ~otherFuture
}