Skip to content

Commit

Permalink
monad flatmap op >>= alias
Browse files Browse the repository at this point in the history
  • Loading branch information
Maciej Kowalski committed Jan 23, 2019
1 parent 51f0871 commit 95bd331
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/scala/fp/typeclasses/Monad.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import simulacrum.{op, typeclass}

@typeclass
trait Monad[F[_]] extends Applicative[F] {
@op(">>=") def flatMap[A, B](fa: F[A])(f: A => F[B]): F[B]

@op(">>=", alias = true)
def flatMap[A, B](fa: F[A])(f: A => F[B]): F[B]
}

object Monad {
Expand Down

0 comments on commit 95bd331

Please sign in to comment.