Created
March 20, 2019 07:29
-
-
Save monadplus/e68a1ee4afbda5d9fa7a22d3218cc67a to your computer and use it in GitHub Desktop.
Kind projector function syntax
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
// underlying: Ref[F, A] | |
// trans: F ~> G | |
// underlying.access: F[(A, A => F[Boolean])] | |
// Mapping from F[(A, A => F[Boolean])] to G[(A, A => G[Boolean])] | |
override def access: G[(A, A => G[Boolean])] = | |
trans(F.compose[(A, ?)].compose[A => ?].map(underlying.access)(trans(_))) | |
// Step by Step | |
// Functor[F[_]] // compose[(A, ?)] | |
// -> Functor[F[(A, _)]] // compose[A => ?] | |
// -> Functor[F[(A, A => _)]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment