Created
October 10, 2016 14:37
-
-
Save paulp/513f5bcc327fa4259f326e3dbcc8123a 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
type Algebra[F[_], A] = F[A] => A | |
type AlgebraM[M[_], F[_], A] = F[A] => M[A] // Why isn't F ~> M sufficient? | |
type Coalgebra[F[_], A] = A => F[A] | |
/** What do these type aliases buy - they are composing type | |
* constructors in different orders, but no more simply? | |
*/ | |
type GAlgebra[W[_], F[_], A] = Algebra [ λ[X => F[W[X]]], A] | |
type GAlgebraM[W[_], M[_], F[_], A] = AlgebraM[M, λ[X => F[W[X]]], A] | |
type GCoalgebraM[N[_], M[_], F[_], A] = Coalgebra[λ[X => M[F[N[X]]]], A] | |
type GCoalgebra[N[_], F[_], A] = Coalgebra[λ[X => F[N[X]]] , A] | |
type CoalgebraM[M[_], F[_], A] = Coalgebra[λ[X => M[ F[X]] ], A] | |
type ElgotCoalgebraM[E[_], M[_], F[_], A] = Coalgebra[λ[X => M[E[F[X]]]], A] | |
type ElgotCoalgebra[E[_], F[_], A] = Coalgebra[λ[X => E[F[X]]] , A] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The aliases on the left are clearer in a narrow context, assuming they are used meaningfully. But when they aren't used consistently, then you multiply the number of names and concepts yet one still must recognize both forms.
If it's
case class ElgotCoalgebraM[E[_], M[_], F[_], A](run: Coalgebra[λ[X => M[E[F[X]]]], A])
then it means something when you have anElgotCoalgebraM
in your type signature. But as a type alias it's just one of many permutations of letters.