Skip to content

Commit

Permalink
version 2.5.1, fix #1141
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanti committed Feb 20, 2020
1 parent bd17f4b commit 94614f3
Show file tree
Hide file tree
Showing 14 changed files with 202 additions and 87 deletions.
11 changes: 3 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,20 @@ high state of flux, you're at risk of it changing without notice.

# 2.5.1

- **Polish**
- `These`
- add missing `MonadThrow` instance (@gcanti)

# 2.5.0

- **New Feature**
- add overloadings to `zip`, `zipWith` and `unzip`, closes #1109 (@gcanti)
- add `eqStrict`, closes #965 (@gcanti)
- `Eq`
- add `eqStrict`, closes #965 (@gcanti)
- `NonEmptyArray`
- add `fold` (@vicrac)
- add `zip`, `zipWith` and `unzip`, closes #1109 (@gcanti)
- `Semigroup`
- add `getIntercalateSemigroup` (@gcanti)
- `Set`
- add `toggle` (@ryota-ka)
- `TaskEither`
- add `tryCatchK` (@DenisFrezzato)
- `These`
- add missing `MonadThrow` instance (@gcanti)
- `ReaderTaskEither`
- add missing `leftReaderTask`, `rightReaderTask` functions (@gcanti)
- `StateReaderTaskEither`
Expand Down
15 changes: 3 additions & 12 deletions docs/modules/Array.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -1687,10 +1687,7 @@ The function is reverse of `zip`. Takes an array of pairs and return two corresp
**Signature**

```ts
export const unzip: {
<A, B>(as: NonEmptyArray<[A, B]>): [NonEmptyArray<A>, NonEmptyArray<B>]
<A, B>(as: Array<[A, B]>): [Array<A>, Array<B>]
} = ...
export const unzip: <A, B>(as: Array<[A, B]>) => [Array<A>, Array<B>] = ...
```

**Example**
Expand Down Expand Up @@ -1743,10 +1740,7 @@ longer array are discarded
**Signature**

```ts
export const zip: {
<A, B>(fa: NonEmptyArray<A>, fb: NonEmptyArray<B>): NonEmptyArray<[A, B]>
<A, B>(fa: Array<A>, fb: Array<B>): Array<[A, B]>
} = ...
export const zip: <A, B>(fa: Array<A>, fb: Array<B>) => Array<[A, B]> = ...
```

**Example**
Expand All @@ -1771,10 +1765,7 @@ input array is short, excess elements of the longer array are discarded.
**Signature**

```ts
export const zipWith: {
<A, B, C>(fa: NonEmptyArray<A>, fb: NonEmptyArray<B>, f: (a: A, b: B) => C): NonEmptyArray<C>
<A, B, C>(fa: Array<A>, fb: Array<B>, f: (a: A, b: B) => C): Array<C>
} = ...
export const zipWith: <A, B, C>(fa: Array<A>, fb: Array<B>, f: (a: A, b: B) => C) => Array<C> = ...
```

**Example**
Expand Down
37 changes: 37 additions & 0 deletions docs/modules/NonEmptyArray.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ Added in v2.0.0
- [snoc](#snoc)
- [sort](#sort)
- [tail](#tail)
- [unzip](#unzip)
- [updateAt](#updateat)
- [zip](#zip)
- [zipWith](#zipwith)

---

Expand Down Expand Up @@ -621,6 +624,16 @@ export const tail: <A>(nea: NonEmptyArray<A>) => Array<A> = ...

Added in v2.0.0

# unzip

**Signature**

```ts
export const unzip: <A, B>(as: NonEmptyArray<[A, B]>) => [NonEmptyArray<A>, NonEmptyArray<B>] = ...
```

Added in v2.5.1

# updateAt

**Signature**
Expand All @@ -633,3 +646,27 @@ export const updateAt: <A>(
```

Added in v2.0.0

# zip

**Signature**

```ts
export const zip: <A, B>(fa: NonEmptyArray<A>, fb: NonEmptyArray<B>) => NonEmptyArray<[A, B]> = ...
```

Added in v2.5.1

# zipWith

**Signature**

```ts
export const zipWith: <A, B, C>(
fa: NonEmptyArray<A>,
fb: NonEmptyArray<B>,
f: (a: A, b: B) => C
) => NonEmptyArray<C> = ...
```

Added in v2.5.1
12 changes: 0 additions & 12 deletions docs/modules/ReadonlyArray.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -1720,9 +1720,6 @@ The function is reverse of `zip`. Takes an array of pairs and return two corresp
**Signature**

```ts
export function unzip<A, B>(
as: ReadonlyNonEmptyArray<readonly [A, B]>
): readonly [ReadonlyNonEmptyArray<A>, ReadonlyNonEmptyArray<B>]
export function unzip<A, B>(as: ReadonlyArray<readonly [A, B]>): readonly [ReadonlyArray<A>, ReadonlyArray<B>] { ... }
```

Expand Down Expand Up @@ -1776,10 +1773,6 @@ longer array are discarded
**Signature**

```ts
export function zip<A, B>(
fa: ReadonlyNonEmptyArray<A>,
fb: ReadonlyNonEmptyArray<B>
): ReadonlyNonEmptyArray<readonly [A, B]>
export function zip<A, B>(fa: ReadonlyArray<A>, fb: ReadonlyArray<B>): ReadonlyArray<readonly [A, B]> { ... }
```

Expand All @@ -1805,11 +1798,6 @@ input array is short, excess elements of the longer array are discarded.
**Signature**

```ts
export function zipWith<A, B, C>(
fa: ReadonlyNonEmptyArray<A>,
fb: ReadonlyNonEmptyArray<B>,
f: (a: A, b: B) => C
): ReadonlyNonEmptyArray<C>
export function zipWith<A, B, C>(fa: ReadonlyArray<A>, fb: ReadonlyArray<B>, f: (a: A, b: B) => C): ReadonlyArray<C> { ... }
```

Expand Down
42 changes: 42 additions & 0 deletions docs/modules/ReadonlyNonEmptyArray.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ Added in v2.5.0
- [snoc](#snoc)
- [sort](#sort)
- [tail](#tail)
- [unzip](#unzip)
- [updateAt](#updateat)
- [zip](#zip)
- [zipWith](#zipwith)

---

Expand Down Expand Up @@ -618,6 +621,18 @@ export function tail<A>(nea: ReadonlyNonEmptyArray<A>): ReadonlyArray<A> { ... }

Added in v2.5.0

# unzip

**Signature**

```ts
export const unzip: <A, B>(
as: ReadonlyNonEmptyArray<readonly [A, B]>
) => readonly [ReadonlyNonEmptyArray<A>, ReadonlyNonEmptyArray<B>] = ...
```

Added in v2.5.1

# updateAt

**Signature**
Expand All @@ -627,3 +642,30 @@ export function updateAt<A>(i: number, a: A): (nea: ReadonlyNonEmptyArray<A>) =>
```

Added in v2.5.0

# zip

**Signature**

```ts
export const zip: <A, B>(
fa: ReadonlyNonEmptyArray<A>,
fb: ReadonlyNonEmptyArray<B>
) => ReadonlyNonEmptyArray<readonly [A, B]> = ...
```

Added in v2.5.1

# zipWith

**Signature**

```ts
export const zipWith: <A, B, C>(
fa: ReadonlyNonEmptyArray<A>,
fb: ReadonlyNonEmptyArray<B>,
f: (a: A, b: B) => C
) => ReadonlyNonEmptyArray<C> = ...
```

Added in v2.5.1
9 changes: 2 additions & 7 deletions dtslint/ts3.5/Array.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
import * as _ from '../../src/Array'
import { NonEmptyArray } from '../../src/NonEmptyArray'
import { pipe } from '../../src/pipeable'

declare const ns: Array<number>
declare const ss: Array<string>
declare const nens: NonEmptyArray<number>
declare const sess: NonEmptyArray<string>
declare const tns: Array<[number, string]>
declare const netns: NonEmptyArray<[number, string]>

//
// zip
//

_.zip(ns, ss) // $ExpectType [number, string][]
_.zip(nens, sess) // $ExpectType NonEmptyArray<[number, string]>

//
// zipWith
//

_.zipWith(ns, ss, (n, s) => [n, s] as const) // $ExpectType (readonly [number, string])[]
_.zipWith(nens, sess, (n, s) => [n, s] as const) // $ExpectType NonEmptyArray<readonly [number, string]>

//
// unzip
//

_.unzip(tns) // $ExpectType [number[], string[]]
_.unzip(netns) // $ExpectType [NonEmptyArray<number>, NonEmptyArray<string>]
pipe(tns, _.unzip) // $ExpectType [number[], string[]]
38 changes: 30 additions & 8 deletions dtslint/ts3.5/NonEmptyArray.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,50 @@
import * as NEA from '../../src/NonEmptyArray'
import * as _ from '../../src/NonEmptyArray'
import { ordString } from '../../src/Ord'
import { eqString } from '../../src/Eq'
import { pipe } from '../../src/pipeable'

declare const as: Array<string>
declare const neas: NEA.NonEmptyArray<string>
declare const neas: _.NonEmptyArray<string>
declare const nens: _.NonEmptyArray<number>
declare const netns: _.NonEmptyArray<[number, string]>

neas.sort(ordString.compare) // $ExpectType NonEmptyArray<string>
//
// zip
//

_.zip(nens, neas) // $ExpectType NonEmptyArray<[number, string]>

//
// zipWith
//

_.zipWith(nens, neas, (n, s) => [n, s] as const) // $ExpectType NonEmptyArray<readonly [number, string]>

//
// unzip
//

_.unzip(netns) // $ExpectType [NonEmptyArray<number>, NonEmptyArray<string>]
pipe(netns, _.unzip) // $ExpectType [NonEmptyArray<number>, NonEmptyArray<string>]

//
// sort
//

NEA.sort(ordString)(neas) // $ExpectType NonEmptyArray<string>
neas.sort(ordString.compare) // $ExpectType NonEmptyArray<string>

_.sort(ordString)(neas) // $ExpectType NonEmptyArray<string>

//
// cons
//

NEA.cons(1, []) // $ExpectType NonEmptyArray<1>
NEA.cons(1, [2, 3]) // $ExpectType NonEmptyArray<number>
_.cons(1, []) // $ExpectType NonEmptyArray<1>
_.cons(1, [2, 3]) // $ExpectType NonEmptyArray<number>

//
// group
//

NEA.group(eqString)(as) // $ExpectType NonEmptyArray<string>[]
NEA.group(eqString)(neas) // $ExpectType NonEmptyArray<NonEmptyArray<string>>
_.group(eqString)(as) // $ExpectType NonEmptyArray<string>[]
_.group(eqString)(neas) // $ExpectType NonEmptyArray<NonEmptyArray<string>>
21 changes: 8 additions & 13 deletions dtslint/ts3.5/ReadonlyArray.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
import * as _ from '../../src/ReadonlyArray'
import { ReadonlyNonEmptyArray } from '../../src/ReadonlyNonEmptyArray'
import { pipe } from '../../src/pipeable'

declare const ns: ReadonlyArray<number>
declare const ss: ReadonlyArray<string>
declare const nens: ReadonlyNonEmptyArray<number>
declare const sess: ReadonlyNonEmptyArray<string>
declare const tns: ReadonlyArray<readonly [number, string]>
declare const netns: ReadonlyNonEmptyArray<readonly [number, string]>
declare const rns: ReadonlyArray<number>
declare const rss: ReadonlyArray<string>
declare const rtns: ReadonlyArray<readonly [number, string]>

//
// zip
//

_.zip(ns, ss) // $ExpectType readonly (readonly [number, string])[]
_.zip(nens, sess) // $ExpectType ReadonlyNonEmptyArray<readonly [number, string]>
_.zip(rns, rss) // $ExpectType readonly (readonly [number, string])[]

//
// zipWith
//

_.zipWith(ns, ss, (n, s) => [n, s] as const) // $ExpectType readonly (readonly [number, string])[]
_.zipWith(nens, sess, (n, s) => [n, s] as const) // $ExpectType ReadonlyNonEmptyArray<readonly [number, string]>
_.zipWith(rns, rss, (n, s) => [n, s] as const) // $ExpectType readonly (readonly [number, string])[]

//
// unzip
//

_.unzip(tns) // $ExpectType readonly [readonly number[], readonly string[]]
_.unzip(netns) // $ExpectType readonly [ReadonlyNonEmptyArray<number>, ReadonlyNonEmptyArray<string>]
_.unzip(rtns) // $ExpectType readonly [readonly number[], readonly string[]]
pipe(rtns, _.unzip) // $ExpectType readonly [readonly number[], readonly string[]]
25 changes: 25 additions & 0 deletions dtslint/ts3.5/ReadonlyNonEmptyArray.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import * as _ from '../../src/ReadonlyNonEmptyArray'
import { pipe } from '../../src/pipeable'

declare const rneas: _.ReadonlyNonEmptyArray<string>
declare const rnens: _.ReadonlyNonEmptyArray<number>
declare const rnetns: _.ReadonlyNonEmptyArray<[number, string]>

//
// zip
//

_.zip(rnens, rneas) // $ExpectType ReadonlyNonEmptyArray<readonly [number, string]>

//
// zipWith
//

_.zipWith(rnens, rneas, (n, s) => [n, s] as const) // $ExpectType ReadonlyNonEmptyArray<readonly [number, string]>

//
// unzip
//

_.unzip(rnetns) // $ExpectType readonly [ReadonlyNonEmptyArray<number>, ReadonlyNonEmptyArray<string>]
pipe(rnetns, _.unzip) // $ExpectType readonly [ReadonlyNonEmptyArray<number>, ReadonlyNonEmptyArray<string>]
Loading

0 comments on commit 94614f3

Please sign in to comment.