The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

guybrush (5) [Avatar] Offline
I'm not pretty sure is this is the way to go about pipelining steps or even if it works on Scalaz 7 because Validation is not a monad and therefore
it shouldn't work in for comprehension. From scalaz group the recommend the use of the Disjunction operator(\/) which is straightforward to get from
a Validation object.

object OrderTotalConverter1 {
def convert(rawCurrency: String, rawAmount: String):
ValidationNel[String, OrderTotal] = { // b
for {
total <- OT.parse(rawCurrency, rawAmount) // b
rate <- ERL.lookup(total.currency).toValidationNel // c
©Manning Publications Co. We welcome reader comments about anything in the manuscript - other than typos and
other simple mistakes. These will be cleaned up during production of the book by copyeditors and proofreaders.
Licensed to Farid Hafhafi Gutierrez <>
base = OT(Currency.Eur, total.amount * rate) // d
} yield base