Inheritance: implements Widmogrod\Monad\Maybe\Maybe, use trait Widmogrod\Common\PointedTrait
Exemplo n.º 1
0
 public function provideFunctorTestData()
 {
     return ['Just' => ['$f' => function ($x) {
         return $x + 1;
     }, '$g' => function ($x) {
         return $x + 5;
     }, '$x' => Just::of(1)], 'Nothing' => ['$f' => function ($x) {
         return $x + 1;
     }, '$g' => function ($x) {
         return $x + 5;
     }, '$x' => Nothing::of(1)]];
 }
Exemplo n.º 2
0
/**
 * @return Just
 *
 * @param mixed $value
 */
function just($value)
{
    return Just::of($value);
}