compose

object compose extends ComposeSyntax
class Object
trait Matchable
class Any

Type members

Inherited types

type [F[_], G[_]] = { type λ = [α] =>> F[G[α]]; }

Compose two functors F and G.

Compose two functors F and G.

This allows you to inline what would otherwise require a type alias.

Consider the method

def method[F[_]]: Unit = ()

Calling method with a simple type is easy:

method[Option]

Calling method with a nested type is more complicated. The traditional way to do this is to use an alias:

type ListOption[A] = List[Option[A]]
method[ListOption]

This type provides a convenient (maybe?) way to inline the above type:

method[(List ∘ Option)#λ]

Note: If you have the kind projector plugin enabled, this alias is equivalent to:

method[λ[α => List[Option[α]]]]
Inherited from
ComposeSyntax