These are chat archives for ThoughtWorksInc/Binding.scala

Dec 2017
But in general the issue with using for/yield is that it turns into a map operation, when you really want a flatMap for what you're doing. So an alternative way would be to do:
models flatMap { model =>
          {for (i <- model.contents) yield {
This is only an issue when you're returning a sequence of xml elements from each element in a Vars or some other collection.
Basim Khajwal
Dec 06 2017 17:24
@kahliburke Thanks a lot, I didn't realise the for comprehension was actually using a map operation. In my mind I thought that if it worked for a regular Binding it would also work for a BindingSeq.
Kahli Burke
Dec 06 2017 18:23
@basimkhajwal In scala a for comprehension is syntactic sugar for chaining flatMap, map ->