protected static function predicate(
        callable $predicate,
        string $error
    ) : callable {
        return function ($value) use ($predicate, $error) : Result {
            return $predicate($value)
                ? Result::success()
                : Result::failure($error);
        };
    }