What is the history behind the name Bind & Tap? #486
Replies: 6 comments
-
If there is no specific reason for Bind and Tap, I think there is no need of Tap, Bind can deal with both scenarios. var result = await GetCustomerByIdAsync(id)
.ToResultAsync(Error.NotFound("Customer with such Id is not found: " + id))
.EnsureAsync(customer => customer.CanBePromoted, Error.Validation("Need to ask manager"))
.IfErrorAsync(error => Log(error))
.IfErrorAsync(() => AskManagerAsync(id))
.IfOkAsync(customer => Log("Manager approved promotion"))
.IfOkAsync(customer => customer.PromoteAsync())
.IfOkAsync(customer => EmailGateway.SendPromotionNotificationAsync(customer.Email))
.UnwrapAsync(ok => "Okay", error => error.Message); Opinions? |
Beta Was this translation helpful? Give feedback.
-
The names are from F# (and other FP languages) and TypeScript respectively. This library tries to avoid introducing its own terminology unless absolutely necessary. But I agree, |
Beta Was this translation helpful? Give feedback.
-
My friends who are familiar with F# have not heard of Tap. I found one article but it uses, map, then and join |
Beta Was this translation helpful? Give feedback.
-
Are the names based on https://fsharpforfunandprofit.com/rop/ ? Using a list of custom error types on both the left and right sides of Either (rather than, say, Either String a). |
Beta Was this translation helpful? Give feedback.
-
Correct. |
Beta Was this translation helpful? Give feedback.
-
Я заметил есть tap, check & bind. Где-то можно почитать о специфике и различиях? |
Beta Was this translation helpful? Give feedback.
-
What is the history behind the names Bind & Tap?
The names do not express intent.
Beta Was this translation helpful? Give feedback.
All reactions