Free applicative functors. Less expressive than free monads, but more flexible to inspect and interpret.
- Companion
- object
Value members
Concrete methods
Performs a monoidal analysis over this free program. Maps the
effects in F
to values in the monoid M
, discarding the values
of those effects.
Example:
Performs a monoidal analysis over this free program. Maps the
effects in F
to values in the monoid M
, discarding the values
of those effects.
Example:
def count[F[_],B](p: FreeAp[F,B]): Int =
p.analyze(new (F ~> λ[α => Int]) {
def apply[A](a: F[A]) = 1
})
The canonical natural transformation that interprets this free
program by giving it the semantics of the applicative functor G
.
Not tail-recursive unless G
is a free monad.
The canonical natural transformation that interprets this free
program by giving it the semantics of the applicative functor G
.
Not tail-recursive unless G
is a free monad.
The natural transformation from FreeAp[F,_]
to FreeAp[G,_]
The natural transformation from FreeAp[F,_]
to FreeAp[G,_]
Provides access to the first instruction of this program, if present
Provides access to the first instruction of this program, if present