Skip to content

Commit

Permalink
Fix maybe predicate
Browse files Browse the repository at this point in the history
  • Loading branch information
lmnt-dev committed Aug 22, 2020
1 parent 4be4bdc commit a01dd23
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/philo.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,14 @@ function is_right($x)
}

/**
* Return true if null or type $T
* Return true if input is null or type $T
*
* @psalm-template T
* @param T $T
* @return callable(mixed, mixed=) : bool
*/
function maybe($T) {
return fn ($x, $k = null) => $x === null || create($T, $x, $k);
return fn ($x, $k = null) => $x === null || is($T, $x, $k);
}

/**
Expand Down

0 comments on commit a01dd23

Please sign in to comment.