cvogt / flow-comprehensions

Work in progress: Simpler and more powerful alternative to Scala's built-in for-comprehension syntax
Other
25 stars 5 forks source link

rename sequence #6

Open cvogt opened 9 years ago

cvogt commented 9 years ago

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 9 years ago

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
}