From 480b8f374b8309e07b063594abd109ea11a21b57 Mon Sep 17 00:00:00 2001 From: Zach Abbott Date: Thu, 21 Jul 2016 09:54:55 -0500 Subject: [PATCH] Fix missing implicit evidence needed, add doctest example --- core/src/main/scala/cats/data/XorT.scala | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/core/src/main/scala/cats/data/XorT.scala b/core/src/main/scala/cats/data/XorT.scala index b177404c45..c8a4060731 100644 --- a/core/src/main/scala/cats/data/XorT.scala +++ b/core/src/main/scala/cats/data/XorT.scala @@ -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`. *