Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Sink.either combinator #1148

Merged
merged 1 commit into from
May 23, 2018
Merged

Conversation

Daenyth
Copy link
Contributor

@Daenyth Daenyth commented May 23, 2018

We added this at work and it's been useful in our codebase, plus I've
seen the exact need come up in gitter before as well.

@@ -28,4 +30,19 @@ object Sink {
* using the `Show` instance for the input type.
*/
def showLinesStdOut[F[_]: Sync, I: Show]: Sink[F, I] = showLines(Console.out)

/**
* Sink that routes each element to one of two syncs based on Either's Left/Right
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/syncs/sinks/

Maybe reword the end of this a bit? Or just go with:

* Sink that routes each element to one of two sinks -- `Left(x)` values get routed to the `left` sink and `Right(x)` values get routed to the `right` sink.

We added this at work and it's been useful in our codebase, plus I've
seen the exact need come up in gitter before as well.
@mpilquist mpilquist merged commit a35c269 into typelevel:series/0.10 May 23, 2018
@Daenyth Daenyth deleted the sink-either branch September 30, 2019 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants