PHP Class Widmogrod\Helpful\ApplicativeLaws

ファイルを表示 Open project: widmogrod/php-functional Class Usage Examples

Public Methods

Method Description
test ( callable $assertEqual, callable $pure, Widmogrod\FantasyLand\Applicative $u, Widmogrod\FantasyLand\Applicative $v, Widmogrod\FantasyLand\Applicative $w, callable $f, mixed $x ) Generic test to verify if a type obey the applicative laws.

Method Details

test() public static method

Generic test to verify if a type obey the applicative laws.
public static test ( callable $assertEqual, callable $pure, Widmogrod\FantasyLand\Applicative $u, Widmogrod\FantasyLand\Applicative $v, Widmogrod\FantasyLand\Applicative $w, callable $f, mixed $x )
$assertEqual callable Asserting function (Applicative $a1, Applicative $a2, $message)
$pure callable Applicative "constructor"
$u Widmogrod\FantasyLand\Applicative Applicative f => f (a -> b)
$v Widmogrod\FantasyLand\Applicative Applicative f => f (a -> b)
$w Widmogrod\FantasyLand\Applicative Applicative f => f (a -> b)
$f callable (a -> b)
$x mixed Value to put into a applicative