Created
December 13, 2015 14:30
-
-
Save suls/aa4c4a531c8f7b31e92d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scala> fooR | |
res15: scalaz.\/[String,Int] = \/-(1) | |
scala> def addOne[M[_]: Applicative](in: M[Int]) = in.map(_+1) | |
warning: there was one feature warning; re-run with -feature for details | |
addOne: [M[_]](in: M[Int])(implicit evidence$1: scalaz.Applicative[M])M[Int] | |
scala> addOne(fooR) | |
<console>:19: error: no type parameters for method addOne: (in: M[Int])(implicit evidence$1: scalaz.Applicative[M])M[Int] exist so that it can be applied to arguments (scalaz.\/[String,Int]) | |
--- because --- | |
argument expression's type is not compatible with formal parameter type; | |
found : scalaz.\/[String,Int] | |
required: ?M[Int] | |
addOne(fooR) | |
^ | |
<console>:19: error: type mismatch; | |
found : scalaz.\/[String,Int] | |
required: M[Int] | |
addOne(fooR) | |
^ | |
<console>:19: error: could not find implicit value for evidence parameter of type scalaz.Applicative[M] | |
addOne(fooR) | |
^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment