/** * Apply function only if the value is not NULL. * * @see \monad\Monad::bind($function) * @see \monad\Chain::emptyChain() */ public function continue(callable $function) : Chain { return parent::bind(conditionally(negation(is_null), $function)); }
/** * {@inheritDoc} * * @see \monad\Monad::bind($function) */ public function bind(callable $function) : Monad { $stream = parent::bind($function); $stream->close_handlers = $this->close_handlers; return $stream; }