On Saturday, January 25, 2020 at 9:46:19 AM UTC+1, Eric Raymond wrote: > [...]
> An early reviewer pointed out that if the Go code were an entire > function it could be expressed something like this: > > --------------------------------------------------------------- > > func pipeline(source T) { > { > result1, err1 := transform1(source) > if err1 != nil { > return err > } > > result2, err2 := transform2(result1) > if err2 != nil { > return err > } > > result3, err3 := transform3(result2) > if err3 != nil { > return err > > return nil > } > > --------------------------------------------------------------- > > That's still a lot of eyeball friction compared to functional-style with > exceptions. And it gets worse faster as the number of stages rises. > > What about introducing a support type. As an example (not tested) https://play.golang.org/p/WkHyEI52xKu > [...] Manlio Perillo -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/82c572c8-b419-479f-b266-6ade6ab461eb%40googlegroups.com.