-
-
Notifications
You must be signed in to change notification settings - Fork 502
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
202 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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[]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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[]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>] |
Oops, something went wrong.