Skip to content

Instantly share code, notes, and snippets.

@Jacoby6000
Last active October 23, 2017 16:53
Show Gist options
  • Save Jacoby6000/7042800aceaa463b8f889441347e2da9 to your computer and use it in GitHub Desktop.
Save Jacoby6000/7042800aceaa463b8f889441347e2da9 to your computer and use it in GitHub Desktop.
sealed trait Pipeline[A, B, C] {
def compose[D, E, F](that: Pipeline[D, E, F]): Compose[A, B, C, D, E] = Compose(this, that)
}
case class Compose[A, B, C, D, E](p1: Pipeline[A, B, C], p2: Pipeline[C, D, E]) extends Pipeline[A, (B, D), E]
case class Run[A, B, C](f: A => B => C) extends Pipeline[A, B, C]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment