Skip to content

Commit

Permalink
add "Derivable from" comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanti committed Oct 28, 2020
1 parent c7523c8 commit 8da80e0
Show file tree
Hide file tree
Showing 42 changed files with 1,475 additions and 1,092 deletions.
154 changes: 82 additions & 72 deletions docs/modules/Array.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,10 @@ Added in v2.0.0
- [of](#of)
- [Apply](#apply)
- [ap](#ap)
- [apFirst](#apfirst)
- [apSecond](#apsecond)
- [Compactable](#compactable)
- [compact](#compact)
- [separate](#separate)
- [Extend](#extend)
- [duplicate](#duplicate)
- [extend](#extend)
- [Filterable](#filterable)
- [filter](#filter)
Expand All @@ -52,8 +49,6 @@ Added in v2.0.0
- [mapWithIndex](#mapwithindex)
- [Monad](#monad)
- [chain](#chain)
- [chainFirst](#chainfirst)
- [flatten](#flatten)
- [Traversable](#traversable)
- [sequence](#sequence)
- [traverse](#traverse)
Expand All @@ -65,12 +60,17 @@ Added in v2.0.0
- [wilt](#wilt)
- [wither](#wither)
- [combinators](#combinators)
- [apFirst](#apfirst)
- [apSecond](#apsecond)
- [chainFirst](#chainfirst)
- [chop](#chop)
- [copy](#copy)
- [difference](#difference)
- [dropLeft](#dropleft)
- [dropLeftWhile](#dropleftwhile)
- [dropRight](#dropright)
- [duplicate](#duplicate)
- [flatten](#flatten)
- [intersection](#intersection)
- [lefts](#lefts)
- [reverse](#reverse)
Expand Down Expand Up @@ -213,30 +213,6 @@ export declare const ap: <A>(fa: A[]) => <B>(fab: ((a: A) => B)[]) => B[]
Added in v2.0.0
## apFirst
Combine two effectful actions, keeping only the result of the first.
**Signature**
```ts
export declare const apFirst: <B>(fb: B[]) => <A>(fa: A[]) => A[]
```
Added in v2.0.0
## apSecond
Combine two effectful actions, keeping only the result of the second.
**Signature**
```ts
export declare const apSecond: <B>(fb: B[]) => <A>(fa: A[]) => B[]
```
Added in v2.0.0
# Compactable
## compact
Expand All @@ -261,16 +237,6 @@ Added in v2.0.0
# Extend
## duplicate
**Signature**
```ts
export declare const duplicate: <A>(wa: A[]) => A[][]
```
Added in v2.0.0
## extend
**Signature**
Expand Down Expand Up @@ -484,39 +450,6 @@ export declare const chain: <A, B>(f: (a: A) => B[]) => (ma: A[]) => B[]
Added in v2.0.0
## chainFirst
Composes computations in sequence, using the return value of one computation to determine the next computation and
keeping only the result of the first.
**Signature**
```ts
export declare const chainFirst: <A, B>(f: (a: A) => B[]) => (ma: A[]) => A[]
```
Added in v2.0.0
## flatten
Removes one level of nesting
**Signature**
```ts
export declare const flatten: <A>(mma: A[][]) => A[]
```
**Example**
```ts
import { flatten } from 'fp-ts/Array'

assert.deepStrictEqual(flatten([[1], [2], [3]]), [1, 2, 3])
```

Added in v2.0.0

# Traversable
## sequence
Expand Down Expand Up @@ -587,6 +520,49 @@ Added in v2.6.5
# combinators
## apFirst
Combine two effectful actions, keeping only the result of the first.
Derivable from `Apply`.
**Signature**
```ts
export declare const apFirst: <B>(fb: B[]) => <A>(fa: A[]) => A[]
```
Added in v2.0.0
## apSecond
Combine two effectful actions, keeping only the result of the second.
Derivable from `Apply`.
**Signature**
```ts
export declare const apSecond: <B>(fb: B[]) => <A>(fa: A[]) => B[]
```
Added in v2.0.0
## chainFirst
Composes computations in sequence, using the return value of one computation to determine the next computation and
keeping only the result of the first.
Derivable from `Monad`.
**Signature**
```ts
export declare const chainFirst: <A, B>(f: (a: A) => B[]) => (ma: A[]) => A[]
```
Added in v2.0.0
## chop
A useful recursion pattern for processing an array to produce a new array, often used for "chopping" up the input
Expand Down Expand Up @@ -709,6 +685,40 @@ assert.deepStrictEqual(dropRight(2)([1, 2, 3, 4, 5]), [1, 2, 3])

Added in v2.0.0

## duplicate

Derivable from `Extend`.

**Signature**

```ts
export declare const duplicate: <A>(wa: A[]) => A[][]
```
Added in v2.0.0
## flatten
Removes one level of nesting.
Derivable from `Monad`.
**Signature**
```ts
export declare const flatten: <A>(mma: A[][]) => A[]
```
**Example**
```ts
import { flatten } from 'fp-ts/Array'

assert.deepStrictEqual(flatten([[1], [2], [3]]), [1, 2, 3])
```

Added in v2.0.0

## intersection

Creates an array of unique values that are included in all given arrays using a `Eq` for equality
Expand Down
Loading

0 comments on commit 8da80e0

Please sign in to comment.