You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I stumbled upon this ceremony while working on composable (#126) algorithms:
func algorithm<T>(_ value:consumingT)->Fallible<T>{varerror:Bool= false
value =foo(value).sink(&error)
value =bar(value).sink(&error)
value =baz(value).sink(&error)returnFallible(value, error: error)}
It isn't terrible, but a Fallible.sink(_:performing:) is perhaps more ergonomic:
func algorithm<T>(_ value:consumingT)->Fallible<T>{Fallible.sink(consume value){
value, error in
value =foo(value).sink(&error)
value =bar(value).sink(&error)
value =baz(value).sink(&error)}}
The text was updated successfully, but these errors were encountered:
I stumbled upon this ceremony while working on composable (#126) algorithms:
It isn't terrible, but a
Fallible.sink(_:performing:)
is perhaps more ergonomic:The text was updated successfully, but these errors were encountered: