small medium large xlarge

Generic-user-small
05 Dec 2017, 20:48
Bartul B (2 posts)

Stuck on chapter 10 for two days now with this one:

let​ placeOrder unvalidatedOrder = ​  unvalidatedOrder ​  |> validateOrderAdapted ​  |> Result.bind priceOrderAdapted ​  |> Result.map acknowledgeOrder ​  |> Result.map createEvents

Got error because createEvents has two inputs but form pipe it gets only OrderAcknowledgmentSent option.
What am I doing wrong?

P.S. Great book, really enjoyed it thus far

Generic-user-small
06 Dec 2017, 11:07
Scott Wlaschin (23 posts)

You’re not doing anything wrong – that code doesn’t actually compile, sorry! It was really just to show how a pipeline could be constructed. I will try to correct that in the final copy. The correct implementation is later, in the section “Making Life Easier with Computation Expressions”.

Generic-user-small
06 Dec 2017, 16:12
Bartul B (2 posts)

Thanks for swift answer!

No worries, forced me to play with Result.map and bind more and got better understanding in return (no pun intended)

You must be logged in to comment