Skip to content

Commit

Permalink
use bare fp-ts import everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
osdiab committed Aug 7, 2020
1 parent 67dc5a2 commit 6fbfbe4
Show file tree
Hide file tree
Showing 48 changed files with 65 additions and 65 deletions.
2 changes: 1 addition & 1 deletion docs/modules/DateFromISOString.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const DateFromISOString: DateFromISOStringC = ...

```ts
import { DateFromISOString } from 'io-ts-types/lib/DateFromISOString'
import { right } from 'fp-ts/lib/Either'
import { right } from 'fp-ts/Either'

const date = new Date(1973, 10, 30)
const input = date.toISOString()
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/DateFromNumber.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const DateFromNumber: DateFromNumberC = ...

```ts
import { DateFromNumber } from 'io-ts-types/lib/DateFromNumber'
import { right } from 'fp-ts/lib/Either'
import { right } from 'fp-ts/Either'

const date = new Date(1973, 10, 30)
const input = date.getTime()
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/DateFromUnixTime.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const DateFromUnixTime: DateFromUnixTimeC = ...

```ts
import { DateFromUnixTime } from 'io-ts-types/lib/DateFromUnixTime'
import { right } from 'fp-ts/lib/Either'
import { right } from 'fp-ts/Either'

const date = new Date(1973, 10, 30)
const input = date.getTime() / 1000
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/IntFromString.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const IntFromString: IntFromStringC = ...

```ts
import { IntFromString } from 'io-ts-types/lib/IntFromString'
import { right } from 'fp-ts/lib/Either'
import { right } from 'fp-ts/Either'
import { PathReporter } from 'io-ts/lib/PathReporter'

assert.deepStrictEqual(IntFromString.decode('1'), right(1))
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/NonEmptyString.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const NonEmptyString: NonEmptyStringC = ...

```ts
import { NonEmptyString } from 'io-ts-types/lib/NonEmptyString'
import { right } from 'fp-ts/lib/Either'
import { right } from 'fp-ts/Either'
import { PathReporter } from 'io-ts/lib/PathReporter'

assert.deepStrictEqual(NonEmptyString.decode('a'), right('a'))
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/UUID.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const UUID: t.BrandC<t.StringC, UUIDBrand> = ...

```ts
import { UUID } from 'io-ts-types/lib/UUID'
import { right } from 'fp-ts/lib/Either'
import { right } from 'fp-ts/Either'
import { PathReporter } from 'io-ts/lib/PathReporter'

assert.deepStrictEqual(
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/either.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function either<L extends t.Mixed, R extends t.Mixed>(

```ts
import { either } from 'io-ts-types/lib/either'
import { left, right } from 'fp-ts/lib/Either'
import { left, right } from 'fp-ts/Either'
import * as t from 'io-ts'
import { PathReporter } from 'io-ts/lib/PathReporter'

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/fromNewtype.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function fromNewtype<N extends AnyNewtype = never>(
```ts
import { fromNewtype } from 'io-ts-types/lib/fromNewtype'
import * as t from 'io-ts'
import { right } from 'fp-ts/lib/Either'
import { right } from 'fp-ts/Either'
import { PathReporter } from 'io-ts/lib/PathReporter'
import { Newtype, iso } from 'newtype-ts'

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/fromNullable.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function fromNullable<C extends t.Mixed>(codec: C, a: t.TypeOf<C>, name =
```ts
import { fromNullable } from 'io-ts-types/lib/fromNullable'
import * as t from 'io-ts'
import { right } from 'fp-ts/lib/Either'
import { right } from 'fp-ts/Either'
import { PathReporter } from 'io-ts/lib/PathReporter'

const T = fromNullable(t.number, -1)
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/mapOutput.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function mapOutput<A, O, I, P>(
import * as t from 'io-ts'
import { mapOutput } from 'io-ts-types/lib/mapOutput'
import { optionFromNullable } from 'io-ts-types/lib/optionFromNullable'
import { none, some } from 'fp-ts/lib/Option'
import { none, some } from 'fp-ts/Option'

// Input: t.Type<Option<number>, number | null, t.mixed>
const Input = optionFromNullable(t.number)
Expand Down
4 changes: 2 additions & 2 deletions docs/modules/option.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export interface OptionC<C extends t.Mixed> extends t.Type<Option<t.TypeOf<C>>,

```ts
import { option } from 'io-ts-types/lib/option'
import { right } from 'fp-ts/lib/Either'
import { none, some } from 'fp-ts/lib/Option'
import { right } from 'fp-ts/Either'
import { none, some } from 'fp-ts/Option'
import * as t from 'io-ts'
import { PathReporter } from 'io-ts/lib/PathReporter'

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/regexp.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const regexp: RegExpC = ...

```ts
import { regexp } from 'io-ts-types/lib/regexp'
import { right } from 'fp-ts/lib/Either'
import { right } from 'fp-ts/Either'

const input1 = /\w+/
const input2 = new RegExp('\\w+')
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/withFallback.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function withFallback<C extends t.Any>(codec: C, a: t.TypeOf<C>, name = `
```ts
import { withFallback } from 'io-ts-types/lib/withFallback'
import * as t from 'io-ts'
import { right } from 'fp-ts/lib/Either'
import { right } from 'fp-ts/Either'

const T = withFallback(t.number, -1)

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/withMessage.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function withMessage<C extends t.Any>(codec: C, message: (i: t.InputOf<C>
import { withMessage } from 'io-ts-types/lib/withMessage'
import * as t from 'io-ts'
import { PathReporter } from 'io-ts/lib/PathReporter'
import { right } from 'fp-ts/lib/Either'
import { right } from 'fp-ts/Either'

const T = withMessage(t.number, () => 'Invalid number')

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/withValidate.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function withValidate<C extends t.Any>(codec: C, validate: C['validate'],
import { withValidate } from 'io-ts-types/lib/withValidate'
import * as t from 'io-ts'
import { PathReporter } from 'io-ts/lib/PathReporter'
import { either, right } from 'fp-ts/lib/Either'
import { either, right } from 'fp-ts/Either'

const T = withValidate(t.number, (u, c) => either.map(t.number.validate(u, c), n => n * 2))

Expand Down
2 changes: 1 addition & 1 deletion dtslint/ts3.5/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ordNumber } from 'fp-ts/lib/Ord'
import { ordNumber } from 'fp-ts/Ord'
import * as t from 'io-ts'
import { either, nonEmptyArray, NumberFromString, option, optionFromNullable, setFromArray } from '../../src'

Expand Down
2 changes: 1 addition & 1 deletion dtslint/ts3.5/readonlySetFromArray.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as t from 'io-ts'
import { readonlySetFromArray } from '../../src'
import { ordString } from 'fp-ts/lib/Ord'
import { ordString } from 'fp-ts/Ord'

const RS = readonlySetFromArray(t.string, ordString)

Expand Down
2 changes: 1 addition & 1 deletion src/BooleanFromString.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @since 0.5.0
*/
import * as t from 'io-ts'
import { either } from 'fp-ts/lib/Either'
import { either } from 'fp-ts/Either'

/**
* @since 0.5.0
Expand Down
4 changes: 2 additions & 2 deletions src/DateFromISOString.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @since 0.5.0
*/
import * as t from 'io-ts'
import { either } from 'fp-ts/lib/Either'
import { either } from 'fp-ts/Either'

/**
* @since 0.5.0
Expand All @@ -12,7 +12,7 @@ export interface DateFromISOStringC extends t.Type<Date, string, unknown> {}
/**
* @example
* import { DateFromISOString } from 'io-ts-types/lib/DateFromISOString'
* import { right } from 'fp-ts/lib/Either'
* import { right } from 'fp-ts/Either'
*
* const date = new Date(1973, 10, 30)
* const input = date.toISOString()
Expand Down
4 changes: 2 additions & 2 deletions src/DateFromNumber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @since 0.5.0
*/
import * as t from 'io-ts'
import { either } from 'fp-ts/lib/Either'
import { either } from 'fp-ts/Either'

/**
* @since 0.5.0
Expand All @@ -12,7 +12,7 @@ export interface DateFromNumberC extends t.Type<Date, number, unknown> {}
/**
* @example
* import { DateFromNumber } from 'io-ts-types/lib/DateFromNumber'
* import { right } from 'fp-ts/lib/Either'
* import { right } from 'fp-ts/Either'
*
* const date = new Date(1973, 10, 30)
* const input = date.getTime()
Expand Down
4 changes: 2 additions & 2 deletions src/DateFromUnixTime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @since 0.5.0
*/
import * as t from 'io-ts'
import { either } from 'fp-ts/lib/Either'
import { either } from 'fp-ts/Either'

/**
* @since 0.5.0
Expand All @@ -12,7 +12,7 @@ export interface DateFromUnixTimeC extends t.Type<Date, number, unknown> {}
/**
* @example
* import { DateFromUnixTime } from 'io-ts-types/lib/DateFromUnixTime'
* import { right } from 'fp-ts/lib/Either'
* import { right } from 'fp-ts/Either'
*
* const date = new Date(1973, 10, 30)
* const input = date.getTime() / 1000
Expand Down
4 changes: 2 additions & 2 deletions src/IntFromString.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import * as t from 'io-ts'
import { NumberFromString } from './NumberFromString'
import { either } from 'fp-ts/lib/Either'
import { either } from 'fp-ts/Either'

/**
* @since 0.4.4
Expand All @@ -15,7 +15,7 @@ export interface IntFromStringC extends t.Type<t.Int, string, unknown> {}
*
* @example
* import { IntFromString } from 'io-ts-types/lib/IntFromString'
* import { right } from 'fp-ts/lib/Either'
* import { right } from 'fp-ts/Either'
* import { PathReporter } from 'io-ts/lib/PathReporter'
*
* assert.deepStrictEqual(IntFromString.decode('1'), right(1))
Expand Down
2 changes: 1 addition & 1 deletion src/NonEmptyString.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface NonEmptyStringC extends t.Type<NonEmptyString, string, unknown>
*
* @example
* import { NonEmptyString } from 'io-ts-types/lib/NonEmptyString'
* import { right } from 'fp-ts/lib/Either'
* import { right } from 'fp-ts/Either'
* import { PathReporter } from 'io-ts/lib/PathReporter'
*
* assert.deepStrictEqual(NonEmptyString.decode('a'), right('a'))
Expand Down
2 changes: 1 addition & 1 deletion src/NumberFromString.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @since 0.5.0
*/
import * as t from 'io-ts'
import { either } from 'fp-ts/lib/Either'
import { either } from 'fp-ts/Either'

/**
* @since 0.5.0
Expand Down
2 changes: 1 addition & 1 deletion src/UUID.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export type UUID = t.Branded<string, UUIDBrand>
/**
* @example
* import { UUID } from 'io-ts-types/lib/UUID'
* import { right } from 'fp-ts/lib/Either'
* import { right } from 'fp-ts/Either'
* import { PathReporter } from 'io-ts/lib/PathReporter'
*
* assert.deepStrictEqual(UUID.decode('00000000-0000-0000-0000-000000000000'), right('00000000-0000-0000-0000-000000000000'))
Expand Down
4 changes: 2 additions & 2 deletions src/either.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @since 0.5.0
*/
import * as t from 'io-ts'
import { Either } from 'fp-ts/lib/Either'
import { Either } from 'fp-ts/Either'

const leftLiteral = t.literal('Left')

Expand All @@ -20,7 +20,7 @@ export interface EitherC<L extends t.Mixed, R extends t.Mixed>
*
* @example
* import { either } from 'io-ts-types/lib/either'
* import { left, right } from 'fp-ts/lib/Either'
* import { left, right } from 'fp-ts/Either'
* import * as t from 'io-ts'
* import { PathReporter } from 'io-ts/lib/PathReporter'
*
Expand Down
4 changes: 2 additions & 2 deletions src/fromNewtype.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
*/
import { AnyNewtype, CarrierOf, iso } from 'newtype-ts'
import * as t from 'io-ts'
import { either } from 'fp-ts/lib/Either'
import { either } from 'fp-ts/Either'

/**
* Returns a codec from a newtype
*
* @example
* import { fromNewtype } from 'io-ts-types/lib/fromNewtype'
* import * as t from 'io-ts'
* import { right } from 'fp-ts/lib/Either'
* import { right } from 'fp-ts/Either'
* import { PathReporter } from 'io-ts/lib/PathReporter'
* import { Newtype, iso } from 'newtype-ts'
*
Expand Down
2 changes: 1 addition & 1 deletion src/fromNullable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { withValidate } from './withValidate'
* @example
* import { fromNullable } from 'io-ts-types/lib/fromNullable'
* import * as t from 'io-ts'
* import { right } from 'fp-ts/lib/Either'
* import { right } from 'fp-ts/Either'
* import { PathReporter } from 'io-ts/lib/PathReporter'
*
* const T = fromNullable(t.number, -1)
Expand Down
2 changes: 1 addition & 1 deletion src/mapOutput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import * as t from 'io-ts'
* import * as t from 'io-ts'
* import { mapOutput } from 'io-ts-types/lib/mapOutput'
* import { optionFromNullable } from 'io-ts-types/lib/optionFromNullable'
* import { none, some } from 'fp-ts/lib/Option'
* import { none, some } from 'fp-ts/Option'
*
* // Input: t.Type<Option<number>, number | null, t.mixed>
* const Input = optionFromNullable(t.number)
Expand Down
8 changes: 4 additions & 4 deletions src/nonEmptyArray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* @since 0.5.0
*/
import * as t from 'io-ts'
import { NonEmptyArray, fromArray } from 'fp-ts/lib/NonEmptyArray'
import { isNonEmpty } from 'fp-ts/lib/Array'
import { either } from 'fp-ts/lib/Either'
import { isNone } from 'fp-ts/lib/Option'
import { NonEmptyArray, fromArray } from 'fp-ts/NonEmptyArray'
import { isNonEmpty } from 'fp-ts/Array'
import { either } from 'fp-ts/Either'
import { isNone } from 'fp-ts/Option'

/**
* @since 0.5.0
Expand Down
6 changes: 3 additions & 3 deletions src/option.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @since 0.5.0
*/
import * as t from 'io-ts'
import { Option } from 'fp-ts/lib/Option'
import { Option } from 'fp-ts/Option'

const None = t.strict({
_tag: t.literal('None')
Expand All @@ -16,8 +16,8 @@ const someLiteral = t.literal('Some')
*
* @example
* import { option } from 'io-ts-types/lib/option'
* import { right } from 'fp-ts/lib/Either'
* import { none, some } from 'fp-ts/lib/Option'
* import { right } from 'fp-ts/Either'
* import { none, some } from 'fp-ts/Option'
* import * as t from 'io-ts'
* import { PathReporter } from 'io-ts/lib/PathReporter'
*
Expand Down
4 changes: 2 additions & 2 deletions src/optionFromNullable.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* @since 0.5.0
*/
import { either } from 'fp-ts/lib/Either'
import { none, Option, option, some, toNullable } from 'fp-ts/lib/Option'
import { either } from 'fp-ts/Either'
import { none, Option, option, some, toNullable } from 'fp-ts/Option'
import * as t from 'io-ts'
import { option as o } from './option'

Expand Down
2 changes: 1 addition & 1 deletion src/readonlySetFromArray.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @since 0.5.7
*/
import { Ord } from 'fp-ts/lib/Ord'
import { Ord } from 'fp-ts/Ord'
import * as t from 'io-ts'
import { setFromArray } from './setFromArray'

Expand Down
2 changes: 1 addition & 1 deletion src/regexp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface RegExpC extends t.Type<RegExp, RegExp, unknown> {}
/**
* @example
* import { regexp } from 'io-ts-types/lib/regexp'
* import { right } from 'fp-ts/lib/Either'
* import { right } from 'fp-ts/Either'
*
* const input1 = /\w+/
* const input2 = new RegExp('\\w+')
Expand Down
6 changes: 3 additions & 3 deletions src/setFromArray.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* @since 0.5.0
*/
import { Ord } from 'fp-ts/lib/Ord'
import { every, fromArray, toArray } from 'fp-ts/lib/Set'
import { Ord } from 'fp-ts/Ord'
import { every, fromArray, toArray } from 'fp-ts/Set'
import * as t from 'io-ts'
import { either } from 'fp-ts/lib/Either'
import { either } from 'fp-ts/Either'

/**
* @since 0.5.0
Expand Down
Loading

0 comments on commit 6fbfbe4

Please sign in to comment.