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