Created
March 14, 2019 19:33
-
-
Save arosien/2caee726b9c31c693d7b085d2fe11c30 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
import cats._ | |
import cats.data._ | |
import cats.implicits._ | |
object KleisliReader { | |
val k = Kleisli[Id, Int, String](i => (i + 1).toString) | |
Contravariant[Reader[?, String]] // not found | |
Contravariant[Kleisli[Id, ?, String]] // not found | |
val j: Kleisli[Id, (Int, Int), String] = | |
k.contramap { case (s: Int, t: Int) => s } // not found | |
type K[A] = Kleisli[Id, A, String] | |
val CK = Contravariant[K] | |
val k2: K[Int] = k | |
val j2: K[(Int, Int)] = | |
CK.contramap(k2)(_._1) | |
// k.contramap(_._1) // not found | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment