Skip to content

Commit

Permalink
remove mixed annotations from documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Perone authored and marcosh committed Mar 21, 2023
1 parent 83e0bb9 commit 5fec25c
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions docs/typeclasses/Applicative.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface Applicative extends Apply
* @param A $a
* @return F<A>
*/
public function pure(mixed $a);
public function pure($a);
}
```

Expand All @@ -34,13 +34,13 @@ The `Applicative` typeclass needs to satisfy four laws in addition to the `Apply
### Identity

```php
$applicative->apply($applicative->pure(fn(mixed $x): mixed => $x), $y) == $y
$applicative->apply($applicative->pure(fn($x) => $x), $y) == $y
```

### Composition

```php
$applicative->apply($applicative->apply($applicative->apply($applicative->pure(fn (mixed $f, mixed $g): Closure => fn (mixed $x): mixed => $f($g($x))), $a), $b), $c) == $applicative->apply($a, $applicative->apply($b, $c))
$applicative->apply($applicative->apply($applicative->apply($applicative->pure(fn ($f, $g) => fn ($x) => $f($g($x))), $a), $b), $c) == $applicative->apply($a, $applicative->apply($b, $c))
```

### Homomorphism
Expand All @@ -52,7 +52,7 @@ $applicative->apply($applicative->pure($f), $applicative->pure($x)) == $applicat
### Interchange

```php
$applicative->apply($f, $applicative->pure($x)) == $applicative->apply(fn (callable $g): mixed => $g($x), $f)
$applicative->apply($f, $applicative->pure($x)) == $applicative->apply(fn (callable $g) => $g($x), $f)
```

## Implemented instances
Expand Down
4 changes: 2 additions & 2 deletions docs/typeclasses/Bifunctor.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ variables
### Identity

```php
$bifunctor->biMap(fn(mixed $x): mixed => $x, fn(mixed $x): mixed => $x, $a) == $a
$bifunctor->biMap(fn($x) => $x, fn($x) => $x, $a) == $a
```

### Composition

```php
$bifunctor->biMap(fn(mixed $x): mixed => $f($g($x)), fn(mixed $x): mixed => $h($k($x)), $a) == $bifunctor->biMap(fn(mixed $x): mixed => $f($x), fn(mixed $x): mixed => $h($x), $bifunctor->biMap(fn(mixed $x): mixed => $g($x), fn(mixed $x): mixed => $k($x)), $a)
$bifunctor->biMap(fn($x) => $f($g($x)), fn($x) => $h($k($x)), $a) == $bifunctor->biMap(fn($x) => $f($x), fn($x) => $h($x), $bifunctor->biMap(fn($x) => $g($x), fn($x) => $k($x)), $a)
```

## Implemented instances
Expand Down
4 changes: 2 additions & 2 deletions docs/typeclasses/Functor.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ A `Functor` instance needs to abide by two laws:
The identity function should be mapped to the identity function

```php
$functor->map(fn(mixed $x): mixed => $x, $y) == $y
$functor->map(fn($x) => $x, $y) == $y
```

### Composition

Mapping the composition of two functions or composing the mapping of those functions should be the same thing

```php
$functor->map(fn(mixed $x): mixed => $f($g($x)), $y) == $functor->map(fn(mixed $x): mixed => $f($x), $functor->map(fn(mixed $x): mixed => $g($x), $y))
$functor->map(fn($x) => $f($g($x)), $y) == $functor->map(fn($x) => $f($x), $functor->map(fn($x) => $g($x), $y))
```

## Implemented instances
Expand Down
4 changes: 2 additions & 2 deletions docs/typeclasses/Monad.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ $monad->bind($monad->pure($a), $f) == $f($a)
### Right identity

```php
$monad->bind($a, fn(mixed $x): mixed => $monad->pure($x)) == $a
$monad->bind($a, fn($x) => $monad->pure($x)) == $a
```

### Associativity

```php
$monad->bind($a, fn(mixed $x): mixed => $monad->bind($f($x), $g)) == $monad->bind($monad->bind($a, $g), $g)
$monad->bind($a, fn($x) => $monad->bind($f($x), $g)) == $monad->bind($monad->bind($a, $g), $g)
```

## Implemented instances
Expand Down
4 changes: 2 additions & 2 deletions docs/typeclasses/Profunctor.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ contravariant type variable.
### Identity

```php
$profunctor->diMap(fn(mixed $x): mixed => $x, fn(mixed $x): mixed => $x, $a) == $a
$profunctor->diMap(fn($x) => $x, fn($x) => $x, $a) == $a
```

### Composition

```php
$profunctor->diMap(fn(mixed $x): mixed => $f($g($x)), fn(mixed $x): mixed => $h($k($x)), $a) == $profunctor->diMap(fn(mixed $x): mixed => $g($x), fn(mixed $x): mixed => $h($x), $profunctor->diMap(fn(mixed $x): mixed => $f($x), fn(mixed $x): mixed => $k($x)), $a)
$profunctor->diMap(fn($x) => $f($g($x)), fn($x) => $h($k($x)), $a) == $profunctor->diMap(fn($x) => $g($x), fn($x) => $h($x), $profunctor->diMap(fn($x) => $f($x), fn($x) => $k($x)), $a)
```

2 changes: 1 addition & 1 deletion docs/typeclasses/Traversable.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ $t($traversable->traverse($applicative, $f, $x)) == $traversable->traverse($appl
### Identity

```php
$traversable->traverse(new IdentityApplicative(), fn(mixed $x): mixed => new Identity($x), $y) == new Identity($y)
$traversable->traverse(new IdentityApplicative(), fn($x) => new Identity($x), $y) == new Identity($y)
```

### Composition
Expand Down

0 comments on commit 5fec25c

Please sign in to comment.