Skip to content

Commit

Permalink
Fix missing implicit evidence needed, add doctest example
Browse files Browse the repository at this point in the history
  • Loading branch information
Zach Abbott committed Jul 21, 2016
1 parent ff457d9 commit 480b8f3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion core/src/main/scala/cats/data/XorT.scala
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,18 @@ trait XorTFunctions {

/**
* Alias for [[XorT.right]]
* {{{
* scala> import cats.data.XorT
* scala> import cats.instances.option._
* scala> val o: Option[Int] = Some(3)
* scala> val n: Option[Int] = None
* scala> XorT.liftT(o)
* res0: cats.data.XorT[Option,Nothing,Int] = XorT(Some(Right(3)))
* scala> XorT.liftT(n)
* res1: cats.data.XorT[Option,Nothing,Int] = XorT(None)
* }}}
*/
final def liftT[F[_], A, B](fb: F[B]): XorT[F, A, B] = right(fb)
final def liftT[F[_], A, B](fb: F[B])(implicit F: Functor[F]): XorT[F, A, B] = right(fb)

/** Transforms an `Xor` into an `XorT`, lifted into the specified `Applicative`.
*
Expand Down

0 comments on commit 480b8f3

Please sign in to comment.