Skip to content

Commit

Permalink
Merge pull request typelevel#4329 from TimWSpence/nomenclature-semigr…
Browse files Browse the repository at this point in the history
…oupk

Nomenclature for the `SemigroupK` hierarchy
  • Loading branch information
danicheg authored Dec 4, 2022
2 parents 310e333 + 3197c3e commit 48def2a
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions docs/nomenclature.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,36 @@ Like the previous section, we use the `E` for the error parameter type.
| `F[A] => ((A,Int) => B) => F[B]` | `mapWithIndex` |
| `F[A] => ((A,Int) => G[B]) => G[F[B]]` | `traverseWithIndex` | `F: Monad`

### SemigroupK
| Type | Method Name | Constraints |
|------------|--------------|-----------|
| `F[A] => F[A] => F[A]`| `combineK` |
| `F[A] => Int => F[A]` | `combineNK`
| `F[A] => F[B] => F[Either[A, B]]` | `sum` | `F: Functor`
| `IterableOnce[F[A]] => Option[F[A]]` | `combineAllOptionK`

### MonoidK
| Type | Method Name | Constraints |
|------------|--------------|-----------|
| `F[A]` | `empty`
| `F[A] => Boolean` | `isEmpty`
| `IterableOnce[F[A]] => F[A]` | `combineAllK`

### Alternative
| Type | Method Name | Constraints |
|------------|--------------|-----------|
| `F[G[A]] => F[A]` | `unite` | `F: FlatMap` and `G: Foldable`
| `F[G[A, B]] => (F[A], F[B])` | `separate` | `F: FlatMap` and `G: Bifoldable`
| `F[G[A, B]] => (F[A], F[B])` | `separateFoldable` | `F: Foldable` and `G: Bifoldable`
| `Boolean => F[Unit]` | `guard`
| `IterableOnce[A] => F[A]` | `fromIterableOnce`
| `G[A] => F[A]` | `fromFoldable` | `G: Foldable`

### NonEmptyAlternative
| Type | Method Name | Constraints |
|------------|--------------|-----------|
| `A => F[A] => F[A]` | `prependK`
| `F[A] => A => F[A]` | `appendK`

## Transformers

Expand Down

0 comments on commit 48def2a

Please sign in to comment.