scalp
scalp copied to clipboard
Type PartialFunction
Type partial function represents a function which is undefined for some elements of the domain.
Example
f(x) = 42 / x is not defined at x equal 0
Minimal interface
interface PartialFunction
{
public function isDefinedAt($x): bool;
public function __invoke($x);
}
Maybe some additional logic and encapsulation in trait could be a good idea. TDB