Inheritance: extends Widmogrod\FantasyLand\Functor
Esempio n. 1
0
 /**
  * @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());
 }
Esempio n. 2
0
 /**
  * @inheritdoc
  */
 public function ap(FantasyLand\Apply $applicative)
 {
     return $applicative->map($this->value);
 }
Esempio n. 3
0
 /**
  * @inheritdoc
  */
 public function ap(FantasyLand\Apply $b)
 {
     return $b->map($this->value);
 }
Esempio n. 4
0
 public function ap(FantasyLand\Apply $b)
 {
     return $this->bind(function ($f) use($b) {
         return $b->map($f);
     });
 }
Esempio n. 5
0
 /**
  * @inheritdoc
  */
 public function ap(Apply $b)
 {
     return $this->bind(function ($f) use($b) {
         return $b->map($f);
     });
 }