Skip to content

Commit

Permalink
fix non standard imports
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanti committed Oct 24, 2023
1 parent 01b8661 commit 1999e6d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions docs/modules/Array.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ export declare const filter: {
```ts
import { filter } from 'fp-ts/Array'
import { isString } from 'fp-ts/lib/string'
import { isString } from 'fp-ts/string'

assert.deepStrictEqual(filter(isString)(['a', 1, {}, 'b', 5]), ['a', 'b'])
assert.deepStrictEqual(filter((x: number) => x > 0)([-3, 1, -2, 5]), [1, 5])
Expand Down Expand Up @@ -608,7 +608,7 @@ export declare const partition: {
```ts
import { partition } from 'fp-ts/Array'
import { isString } from 'fp-ts/lib/string'
import { isString } from 'fp-ts/string'

assert.deepStrictEqual(partition(isString)(['a', 1, {}, 'b', 5]), { left: [1, {}, 5], right: ['a', 'b'] })
assert.deepStrictEqual(partition((x: number) => x > 0)([-3, 1, -2, 5]), { left: [-3, -2], right: [1, 5] })
Expand All @@ -632,7 +632,7 @@ export declare const partitionMap: <A, B, C>(f: (a: A) => Either<B, C>) => (fa:
```ts
import { partitionMap } from 'fp-ts/Array'
import { Either, left, right } from 'fp-ts/lib/Either'
import { Either, left, right } from 'fp-ts/Either'

const upperIfString = <B>(x: B): Either<B, string> => (typeof x === 'string' ? right(x.toUpperCase()) : left(x))
assert.deepStrictEqual(partitionMap(upperIfString)([-2, 'hello', 6, 7, 'world']), {
Expand All @@ -659,7 +659,7 @@ export declare const partitionMapWithIndex: <A, B, C>(
```ts
import { partitionMapWithIndex } from 'fp-ts/Array'
import { Either, left, right } from 'fp-ts/lib/Either'
import { Either, left, right } from 'fp-ts/Either'

const upperIfStringBefore3 = <B>(index: number, x: B): Either<B, string> =>
index < 3 && typeof x === 'string' ? right(x.toUpperCase()) : left(x)
Expand Down Expand Up @@ -1383,7 +1383,7 @@ export declare function fromPredicate<A>(predicate: Predicate<A>): (a: A) => Arr
```ts
import { fromPredicate } from 'fp-ts/Array'
import { pipe } from 'fp-ts/function'
import { isString } from 'fp-ts/lib/string'
import { isString } from 'fp-ts/string'
assert.deepStrictEqual(pipe('a', fromPredicate(isString)), ['a'])
assert.deepStrictEqual(pipe(7, fromPredicate(isString)), [])
Expand Down Expand Up @@ -1859,7 +1859,7 @@ export declare const traverseWithIndex: PipeableTraverseWithIndex1<'Array', numb

```ts
import { traverseWithIndex } from 'fp-ts/Array'
import { Applicative, left, right } from 'fp-ts/lib/Either'
import { Applicative, left, right } from 'fp-ts/Either'
const f = (index: number, x: unknown) =>
typeof x === 'string' ? right(x.toUpperCase() + index) : left(new Error('not a string'))
Expand Down Expand Up @@ -1892,7 +1892,7 @@ export declare const sequence: Sequence1<'Array'>

```ts
import { sequence } from 'fp-ts/Array'
import { Applicative, left, right } from 'fp-ts/lib/Either'
import { Applicative, left, right } from 'fp-ts/Either'
assert.deepStrictEqual(sequence(Applicative)([right('a'), right('b')]), right(['a', 'b']))
assert.deepStrictEqual(
Expand Down Expand Up @@ -1925,7 +1925,7 @@ export declare const traverse: PipeableTraverse1<'Array'>
```ts
import { traverse } from 'fp-ts/Array'
import { Applicative, left, right } from 'fp-ts/lib/Either'
import { Applicative, left, right } from 'fp-ts/Either'

const f = (x: unknown) => (typeof x === 'string' ? right(x.toUpperCase()) : left(new Error('not a string')))
assert.deepStrictEqual(traverse(Applicative)(f)(['a', 'b']), right(['A', 'B']))
Expand Down
16 changes: 8 additions & 8 deletions src/Array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export const replicate = <A>(n: number, a: A): Array<A> => makeBy(n, () => a)
* @example
* import { fromPredicate } from 'fp-ts/Array'
* import { pipe } from 'fp-ts/function'
* import { isString } from "fp-ts/lib/string";
* import { isString } from "fp-ts/string";
*
* assert.deepStrictEqual(pipe("a", fromPredicate(isString)), ["a"]);
* assert.deepStrictEqual(pipe(7, fromPredicate(isString)), []);
Expand Down Expand Up @@ -1728,7 +1728,7 @@ export const separate = <A, B>(fa: Array<Either<A, B>>): Separated<Array<A>, Arr
*
* @example
* import { filter } from 'fp-ts/Array'
* import { isString } from "fp-ts/lib/string";
* import { isString } from "fp-ts/string";
*
* assert.deepStrictEqual(filter(isString)(["a", 1, {}, "b", 5]), ["a", "b"]);
* assert.deepStrictEqual(filter((x:number) => x > 0)([-3, 1, -2, 5]), [1, 5]);
Expand All @@ -1753,7 +1753,7 @@ export const filter: {
*
* @example
* import { partition } from 'fp-ts/Array'
* import { isString } from "fp-ts/lib/string";
* import { isString } from "fp-ts/string";
*
* assert.deepStrictEqual(partition(isString)(["a", 1, {}, "b", 5]), { left: [1, {}, 5], right: ["a", "b"] });
* assert.deepStrictEqual(partition((x: number) => x > 0)([-3, 1, -2, 5]), { left: [-3, -2], right: [1, 5] });
Expand Down Expand Up @@ -1811,7 +1811,7 @@ export const partitionWithIndex: {
*
* @example
* import { partitionMap } from 'fp-ts/Array'
* import { Either, left, right } from "fp-ts/lib/Either";
* import { Either, left, right } from "fp-ts/Either";
*
* const upperIfString = <B>(x: B): Either<B, string> =>
* typeof x === "string" ? right(x.toUpperCase()) : left(x);
Expand All @@ -1832,7 +1832,7 @@ export const partitionMap: <A, B, C>(f: (a: A) => Either<B, C>) => (fa: Array<A>
*
* @example
* import { partitionMapWithIndex } from 'fp-ts/Array'
* import { Either, left, right } from "fp-ts/lib/Either";
* import { Either, left, right } from "fp-ts/Either";
*
* const upperIfStringBefore3 = <B>(index: number, x: B): Either<B, string> =>
* index < 3 && typeof x === "string" ? right(x.toUpperCase()) : left(x);
Expand Down Expand Up @@ -2071,7 +2071,7 @@ export const reduceRightWithIndex: <A, B>(b: B, f: (i: number, a: A, b: B) => B)
*
* @example
* import { traverse } from 'fp-ts/Array'
* import { Applicative, left, right } from "fp-ts/lib/Either";
* import { Applicative, left, right } from "fp-ts/Either";
*
* const f = (x: unknown) =>
* typeof x === "string" ? right(x.toUpperCase()) : left(new Error("not a string"));
Expand Down Expand Up @@ -2100,7 +2100,7 @@ export const traverse: PipeableTraverse1<URI> = <F>(
*
* @example
* import { sequence } from 'fp-ts/Array'
* import { Applicative, left, right } from "fp-ts/lib/Either";
* import { Applicative, left, right } from "fp-ts/Either";
*
* assert.deepStrictEqual(sequence(Applicative)([right("a"), right("b")]), right(["a", "b"]));
* assert.deepStrictEqual(
Expand All @@ -2127,7 +2127,7 @@ export const sequence: Traversable1<URI>['sequence'] =
*
* @example
* import { traverseWithIndex } from 'fp-ts/Array'
* import { Applicative, left, right } from "fp-ts/lib/Either";
* import { Applicative, left, right } from "fp-ts/Either";
*
* const f = (index:number, x:unknown) =>
* typeof x === "string" ? right(x.toUpperCase() + index) : left(new Error("not a string"));
Expand Down

0 comments on commit 1999e6d

Please sign in to comment.