Created
April 5, 2018 13:17
-
-
Save lgirault/149a55fa0f3725be80ae058f06eb8df2 to your computer and use it in GitHub Desktop.
This file contains 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
package p | |
import cats.Functor | |
case class Const[A, R](value: A) | |
object Const { | |
implicit def constFunctor[X]: Functor[Const[X, ?]] = | |
new Functor[Const[X, ?]] { | |
override def map[A, B](fa: Const[X, A])(f: A => B): Const[X, B] = Const(fa.value) | |
} | |
} | |
case class Toto[A](y: String) // Const[String, A] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment