how do people feel about lifting a value into a ri...
# arrow
c
how do people feel about lifting a value into a right() portion of an either prior to several chained flatmaps? eg
Copy code
return newStockItem.right()
    .flatMap { checkFirstThing(newStockItem) } 
    .flatMap { checkSecondThing(newStockItem) }
vs
Copy code
return checkFirstThing(newStockItem)
    .flatMap { checkSecondThing(newStockItem) }
I find the first a little more readable but does mean extra box operations.
s
Also
Copy code
either {
  checkFirstThing(newStockItem).bind()
  checkSecondThing(newStockItem).bind()
}
c
is that arrow meta or is that available with the standard arrow lib?
s
available in standard lib 🙂
c
that syntax is new to me, perhaps i'll give it a go
reminds me of threading in clojure