Inheritance: implements Widmogrod\FantasyLand\Monad, use trait Widmogrod\Common\PointedTrait
Ejemplo n.º 1
0
/**
 * runReader :: Reader e a -> e -> a
 *
 * Unwrap a reader monad computation as a function.
 *
 * @param M\Reader $reader
 * @param mixed $env
 *
 * @return mixed
 */
function runReader(M\Reader $reader, $env)
{
    return $reader->runReader($env);
}
Ejemplo n.º 2
0
function ask($content)
{
    return R::of(function ($name) use($content) {
        return $content . ($name == 'World' ? '' : ' How are you ?');
    });
}