PHP Class Widmogrod\Monad\State

Inheritance: implements Widmogrod\FantasyLand\Monad, use trait Widmogrod\Common\PointedTrait
Exibir arquivo Open project: widmogrod/php-functional Class Usage Examples

Public Methods

Method Description
__construct ( callable $continuation )
ap ( Widmogrod\FantasyLand\Apply $b )
bind ( callable $function )
map ( callable $function )
runState ( mixed $initialState ) : array runState :: s -> (a, s)

Method Details

__construct() public method

public __construct ( callable $continuation )
$continuation callable

ap() public method

public ap ( Widmogrod\FantasyLand\Apply $b )
$b Widmogrod\FantasyLand\Apply

bind() public method

public bind ( callable $function )
$function callable

map() public method

public map ( callable $function )
$function callable

runState() public method

Run computation on a monad with initial state
public runState ( mixed $initialState ) : array
$initialState mixed
return array