Skip to content

Instantly share code, notes, and snippets.

@noelwelsh
Created October 24, 2014 12:08
Show Gist options
  • Save noelwelsh/f20d6235d086efac0fc7 to your computer and use it in GitHub Desktop.
Save noelwelsh/f20d6235d086efac0fc7 to your computer and use it in GitHub Desktop.
import scalaz.{Functor, Monad}
import scalaz.std.option._
import scalaz.syntax.monad._
import scalaz.syntax.functor._
object SyntaxExamples {
// This works fine
Monad[Option].lift((x: Int) => x + 1)
// could not find implicit value for parameter F: scalaz.Functor[F]
((x: Int) => x + 1).lift
// polymorphic expression cannot be instantiated to expected type;
// found : [A, B](fa: Option[A])(f: A => B)Option[B]
// required: scalaz.Functor[F]
((x: Int) => x + 1).lift(Functor[Option])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment