/** * @inheritdoc * * fs <*> xs = [f x | f <- fs, x <- xs] */ public function ap(FantasyLand\Apply $applicative) { return $this->reduce(function ($accumulator, $value) use($applicative) { /** @var $applicative self */ return f\concatM($accumulator, $applicative->map($value)); }, self::mempty()); }
/** * @inheritdoc */ public function ap(FantasyLand\Apply $applicative) { return $applicative->map($this->value); }
/** * @inheritdoc */ public function ap(FantasyLand\Apply $b) { return $b->map($this->value); }
public function ap(FantasyLand\Apply $b) { return $this->bind(function ($f) use($b) { return $b->map($f); }); }
/** * @inheritdoc */ public function ap(Apply $b) { return $this->bind(function ($f) use($b) { return $b->map($f); }); }