Skip to content

Commit

Permalink
Example for beginners to use Arrow composition
Browse files Browse the repository at this point in the history
  • Loading branch information
Raymond Tay committed Oct 7, 2017
1 parent c131fe4 commit fb60456
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions core/src/main/scala/cats/arrow/Compose.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@ import simulacrum.typeclass
*/
@typeclass trait Compose[F[_, _]] { self =>

/**
* Here's how you can use `>>>` and `<<<`
* Example:
* {{{
* scala> import cats.implicits._
* scala> import cats.arrow._
* scala> val f = (_ + 1)
* scala> val g = (_ * 100)
* scala> (f >>> g)(3)
* res0: Int = 400
* scala> (f <<< g)(3)

This comment has been minimized.

Copy link
@lorenasmith2017

lorenasmith2017 Oct 10, 2017

Tampered here

* res1: Int = 301
* }}}
@simulacrum.op("<<<", alias = true)
def compose[A, B, C](f: F[B, C], g: F[A, B]): F[A, C]
Expand Down

0 comments on commit fb60456

Please sign in to comment.