Created
December 11, 2016 18:39
-
-
Save sellout/4830409b4e9a2a41e9d7b940b64df373 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
trait Ops[T, F[_]] { | |
// currently | |
object transCata { | |
def apply[U] = new PartiallyApplied[U] // PartiallyApplied | |
final class PartiallyApplied[U] { | |
def apply[G[_]: Functor] // unnecessary type param, and seductive constraint syntax | |
(f: F[U] => G[U]) | |
(implicit U: Corecursive.Aux[U, G], BF: Functor[F]) // Aux | |
: U = | |
typeClassInstance.transCata(self)(f) | |
} | |
} | |
// with multiple implicit lists eliminates all of ↑ | |
def transCata[U] | |
(implicit U: Corecursive[U]) | |
(implicit F: Functor[F], B: Functor[U.Base]) | |
(f: F[U] => U.Base[U]) | |
: U = | |
typeClassInstance.transCata(self)(f) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment