Skip to content

Commit

Permalink
feat(eithert): Added an eitherT helpers module with a bindIgnoring fu…
Browse files Browse the repository at this point in the history
…nction
  • Loading branch information
dbousamra committed Jul 27, 2017
1 parent 81f1172 commit 6d89b4d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions core/src/main/scala/com/imageintelligence/EitherTHelpers.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.imageintelligence

import scalaz.Monad
import scalaz.EitherT

object EitherTHelpers {

implicit class EitherTPimp[F[_]: Monad, E, A](e: EitherT[F, E, A]) {
def bindIgnoring[O, B](e2: EitherT[F, O, B]): EitherT[F, O, B] = {
EitherT.right(e.run).flatMap(_ => e2)
}
}

}

0 comments on commit 6d89b4d

Please sign in to comment.