fp-ts-contrib
Advanced tools
Comparing version 0.1.8 to 0.1.9
@@ -16,2 +16,10 @@ # Changelog | ||
# 0.1.9 | ||
- **Bug Fix** | ||
- `Do` | ||
- replace `unknown` with `any`, fix #38 (@gcanti) | ||
- **Polish** | ||
- rewrite es6 imports (@gcanti) | ||
# 0.1.8 | ||
@@ -18,0 +26,0 @@ |
@@ -1,3 +0,3 @@ | ||
import { URI } from 'fp-ts/lib/Array'; | ||
import { Option } from 'fp-ts/lib/Option'; | ||
import { URI } from 'fp-ts/es6/Array'; | ||
import { Option } from 'fp-ts/es6/Option'; | ||
import { Align1 } from './'; | ||
@@ -17,5 +17,5 @@ /** | ||
* @example | ||
* import * as O from 'fp-ts/lib/Option' | ||
* import { lpadZipWith } from 'fp-ts-contrib/lib/Align/Array' | ||
* import { pipe } from 'fp-ts/lib/pipeable' | ||
* import * as O from 'fp-ts/es6/Option' | ||
* import { lpadZipWith } from 'fp-ts-contrib/es6/Align/Array' | ||
* import { pipe } from 'fp-ts/es6/pipeable' | ||
* | ||
@@ -40,4 +40,4 @@ * const f = (ma: O.Option<number>, b: string) => | ||
* @example | ||
* import { some, none } from 'fp-ts/lib/Option' | ||
* import { lpadZip } from 'fp-ts-contrib/lib/Align/Array' | ||
* import { some, none } from 'fp-ts/es6/Option' | ||
* import { lpadZip } from 'fp-ts-contrib/es6/Align/Array' | ||
* | ||
@@ -57,4 +57,4 @@ * assert.deepStrictEqual(lpadZip([1, 2], ['a', 'b', 'c']), [[some(1), 'a'], [some(2), 'b'], [none, 'c']]) | ||
* @example | ||
* import { Option, getOrElse } from 'fp-ts/lib/Option' | ||
* import { rpadZipWith } from 'fp-ts-contrib/lib/Align/Array' | ||
* import { Option, getOrElse } from 'fp-ts/es6/Option' | ||
* import { rpadZipWith } from 'fp-ts-contrib/es6/Align/Array' | ||
* | ||
@@ -75,4 +75,4 @@ * const f = (a: number, mb: Option<string>) => a.toString() + getOrElse(() => '*')(mb) | ||
* @example | ||
* import { some, none } from 'fp-ts/lib/Option' | ||
* import { rpadZip } from 'fp-ts-contrib/lib/Align/Array' | ||
* import { some, none } from 'fp-ts/es6/Option' | ||
* import { rpadZip } from 'fp-ts-contrib/es6/Align/Array' | ||
* | ||
@@ -79,0 +79,0 @@ * assert.deepStrictEqual(rpadZip([1, 2, 3], ['a', 'b']), [[1, some('a')], [2, some('b')], [3, none]]) |
@@ -1,5 +0,5 @@ | ||
import { left, right, both } from 'fp-ts/lib/These'; | ||
import { array, URI } from 'fp-ts/lib/Array'; | ||
import { option } from 'fp-ts/lib/Option'; | ||
import { identity, tuple } from 'fp-ts/lib/function'; | ||
import { left, right, both } from 'fp-ts/es6/These'; | ||
import { array, URI } from 'fp-ts/es6/Array'; | ||
import { option } from 'fp-ts/es6/Option'; | ||
import { identity, tuple } from 'fp-ts/es6/function'; | ||
import { padZipWith } from './'; | ||
@@ -23,5 +23,5 @@ /** | ||
* @example | ||
* import { These } from 'fp-ts/lib/These' | ||
* import { identity } from 'fp-ts/lib/function' | ||
* import { alignArray } from 'fp-ts-contrib/lib/Align/Array' | ||
* import { These } from 'fp-ts/es6/These' | ||
* import { identity } from 'fp-ts/es6/function' | ||
* import { alignArray } from 'fp-ts-contrib/es6/Align/Array' | ||
* | ||
@@ -60,5 +60,5 @@ * const f = (x: These<number, string>) => x.fold(a => a.toString(), identity, (a, b) => a + b) | ||
* @example | ||
* import { These } from 'fp-ts/lib/These' | ||
* import { identity } from 'fp-ts/lib/function' | ||
* import { alignArray } from 'fp-ts-contrib/lib/Align/Array' | ||
* import { These } from 'fp-ts/es6/These' | ||
* import { identity } from 'fp-ts/es6/function' | ||
* import { alignArray } from 'fp-ts-contrib/es6/Align/Array' | ||
* | ||
@@ -82,5 +82,5 @@ * assert.deepStrictEqual(alignArray.align([1, 2], ['a', 'b']), [both(1, 'a'), both(2, 'b')]) | ||
* @example | ||
* import * as O from 'fp-ts/lib/Option' | ||
* import { lpadZipWith } from 'fp-ts-contrib/lib/Align/Array' | ||
* import { pipe } from 'fp-ts/lib/pipeable' | ||
* import * as O from 'fp-ts/es6/Option' | ||
* import { lpadZipWith } from 'fp-ts-contrib/es6/Align/Array' | ||
* import { pipe } from 'fp-ts/es6/pipeable' | ||
* | ||
@@ -107,4 +107,4 @@ * const f = (ma: O.Option<number>, b: string) => | ||
* @example | ||
* import { some, none } from 'fp-ts/lib/Option' | ||
* import { lpadZip } from 'fp-ts-contrib/lib/Align/Array' | ||
* import { some, none } from 'fp-ts/es6/Option' | ||
* import { lpadZip } from 'fp-ts-contrib/es6/Align/Array' | ||
* | ||
@@ -126,4 +126,4 @@ * assert.deepStrictEqual(lpadZip([1, 2], ['a', 'b', 'c']), [[some(1), 'a'], [some(2), 'b'], [none, 'c']]) | ||
* @example | ||
* import { Option, getOrElse } from 'fp-ts/lib/Option' | ||
* import { rpadZipWith } from 'fp-ts-contrib/lib/Align/Array' | ||
* import { Option, getOrElse } from 'fp-ts/es6/Option' | ||
* import { rpadZipWith } from 'fp-ts-contrib/es6/Align/Array' | ||
* | ||
@@ -146,4 +146,4 @@ * const f = (a: number, mb: Option<string>) => a.toString() + getOrElse(() => '*')(mb) | ||
* @example | ||
* import { some, none } from 'fp-ts/lib/Option' | ||
* import { rpadZip } from 'fp-ts-contrib/lib/Align/Array' | ||
* import { some, none } from 'fp-ts/es6/Option' | ||
* import { rpadZip } from 'fp-ts-contrib/es6/Align/Array' | ||
* | ||
@@ -150,0 +150,0 @@ * assert.deepStrictEqual(rpadZip([1, 2, 3], ['a', 'b']), [[1, some('a')], [2, some('b')], [3, none]]) |
@@ -12,5 +12,5 @@ /** | ||
*/ | ||
import { HKT, Kind, Kind2, Kind3, URIS, URIS2, URIS3 } from 'fp-ts/lib/HKT'; | ||
import { Semigroup } from 'fp-ts/lib/Semigroup'; | ||
import { Option } from 'fp-ts/lib/Option'; | ||
import { HKT, Kind, Kind2, Kind3, URIS, URIS2, URIS3 } from 'fp-ts/es6/HKT'; | ||
import { Semigroup } from 'fp-ts/es6/Semigroup'; | ||
import { Option } from 'fp-ts/es6/Option'; | ||
import { Semialign, Semialign1, Semialign2, Semialign2C, Semialign3 } from '../Semialign'; | ||
@@ -51,5 +51,5 @@ /** | ||
* @example | ||
* import { semigroupSum } from 'fp-ts/lib/Semigroup' | ||
* import { salign } from 'fp-ts-contrib/lib/Align' | ||
* import { alignArray } from 'fp-ts-contrib/lib/Align/Array' | ||
* import { semigroupSum } from 'fp-ts/es6/Semigroup' | ||
* import { salign } from 'fp-ts-contrib/es6/Align' | ||
* import { alignArray } from 'fp-ts-contrib/es6/Align/Array' | ||
* | ||
@@ -71,5 +71,5 @@ * assert.deepStrictEqual(salign(alignArray, semigroupSum)([1, 2, 3], [4, 5]), [5, 7, 3]) | ||
* @example | ||
* import { some, none } from 'fp-ts/lib/Option' | ||
* import { padZip } from 'fp-ts-contrib/lib/Align' | ||
* import { alignArray } from 'fp-ts-contrib/lib/Align/Array' | ||
* import { some, none } from 'fp-ts/es6/Option' | ||
* import { padZip } from 'fp-ts-contrib/es6/Align' | ||
* import { alignArray } from 'fp-ts-contrib/es6/Align/Array' | ||
* | ||
@@ -91,6 +91,6 @@ * assert.deepStrictEqual(padZip(alignArray)([1, 2, 3], [4, 5]), [[some(1), some(4)], [some(2), some(5)], [some(3), none]]) | ||
* @example | ||
* import { Option, fold, getOrElse } from 'fp-ts/lib/Option' | ||
* import { padZipWith } from 'fp-ts-contrib/lib/Align' | ||
* import { alignArray } from 'fp-ts-contrib/lib/Align/Array' | ||
* import { pipe } from 'fp-ts/lib/pipeable' | ||
* import { Option, fold, getOrElse } from 'fp-ts/es6/Option' | ||
* import { padZipWith } from 'fp-ts-contrib/es6/Align' | ||
* import { alignArray } from 'fp-ts-contrib/es6/Align/Array' | ||
* import { pipe } from 'fp-ts/es6/pipeable' | ||
* | ||
@@ -97,0 +97,0 @@ * const f = (ma: Option<number>, mb: Option<string>) => |
@@ -1,5 +0,5 @@ | ||
import { identity, tuple } from 'fp-ts/lib/function'; | ||
import { some, none } from 'fp-ts/lib/Option'; | ||
import { fold, bimap } from 'fp-ts/lib/These'; | ||
import { pipe } from 'fp-ts/lib/pipeable'; | ||
import { identity, tuple } from 'fp-ts/es6/function'; | ||
import { some, none } from 'fp-ts/es6/Option'; | ||
import { fold, bimap } from 'fp-ts/es6/These'; | ||
import { pipe } from 'fp-ts/es6/pipeable'; | ||
export function salign(F, S) { | ||
@@ -6,0 +6,0 @@ return (fx, fy) => F.alignWith(fx, fy, fold(identity, identity, S.concat)); |
@@ -1,2 +0,2 @@ | ||
import { URI } from 'fp-ts/lib/Option'; | ||
import { URI } from 'fp-ts/es6/Option'; | ||
import { Align1 } from './'; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,4 +0,4 @@ | ||
import { some, none, option, URI, isSome, isNone } from 'fp-ts/lib/Option'; | ||
import { left, right, both } from 'fp-ts/lib/These'; | ||
import { identity } from 'fp-ts/lib/function'; | ||
import { some, none, option, URI, isSome, isNone } from 'fp-ts/es6/Option'; | ||
import { left, right, both } from 'fp-ts/es6/These'; | ||
import { identity } from 'fp-ts/es6/function'; | ||
/** | ||
@@ -23,6 +23,6 @@ * `Align` instance for `Option`. | ||
* @example | ||
* import { some, none } from 'fp-ts/lib/Option' | ||
* import { These } from 'fp-ts/lib/These' | ||
* import { identity } from 'fp-ts/lib/function' | ||
* import { alignOption } from 'fp-ts-contrib/lib/Align/Option' | ||
* import { some, none } from 'fp-ts/es6/Option' | ||
* import { These } from 'fp-ts/es6/These' | ||
* import { identity } from 'fp-ts/es6/function' | ||
* import { alignOption } from 'fp-ts-contrib/es6/Align/Option' | ||
* | ||
@@ -56,5 +56,5 @@ * const f = (x: These<number, string>) => x.fold(a => a.toString(), identity, (a, b) => a + b) | ||
* @example | ||
* import { some, none } from 'fp-ts/lib/Option' | ||
* import { both, left, right } from 'fp-ts/lib/These' | ||
* import { alignOption } from 'fp-ts-contrib/lib/Align/Option' | ||
* import { some, none } from 'fp-ts/es6/Option' | ||
* import { both, left, right } from 'fp-ts/es6/These' | ||
* import { alignOption } from 'fp-ts-contrib/es6/Align/Option' | ||
* | ||
@@ -61,0 +61,0 @@ * assert.deepStrictEqual(alignOption.align(some(1), some('a')), some(both(1, 'a'))) |
@@ -1,2 +0,2 @@ | ||
import { These } from 'fp-ts/lib/These'; | ||
import { These } from 'fp-ts/es6/These'; | ||
/** | ||
@@ -3,0 +3,0 @@ * @since 0.1.0 |
@@ -1,4 +0,4 @@ | ||
import * as R from 'fp-ts/lib/Record'; | ||
import { left, right, both } from 'fp-ts/lib/These'; | ||
import { identity } from 'fp-ts/lib/function'; | ||
import * as R from 'fp-ts/es6/Record'; | ||
import { left, right, both } from 'fp-ts/es6/These'; | ||
import { identity } from 'fp-ts/es6/function'; | ||
export function alignWith(fa, fb, f) { | ||
@@ -5,0 +5,0 @@ const r = {}; |
@@ -1,5 +0,5 @@ | ||
import { Alt1 } from 'fp-ts/lib/Alt'; | ||
import { Monad1 } from 'fp-ts/lib/Monad'; | ||
import { Option } from 'fp-ts/lib/Option'; | ||
declare module 'fp-ts/lib/HKT' { | ||
import { Alt1 } from 'fp-ts/es6/Alt'; | ||
import { Monad1 } from 'fp-ts/es6/Monad'; | ||
import { Option } from 'fp-ts/es6/Option'; | ||
declare module 'fp-ts/es6/HKT' { | ||
interface URItoKind<A> { | ||
@@ -6,0 +6,0 @@ ArrayOption: ArrayOption<A>; |
@@ -1,4 +0,4 @@ | ||
import { array, of } from 'fp-ts/lib/Array'; | ||
import { getOptionM } from 'fp-ts/lib/OptionT'; | ||
import { pipeable } from 'fp-ts/lib/pipeable'; | ||
import { array, of } from 'fp-ts/es6/Array'; | ||
import { getOptionM } from 'fp-ts/es6/OptionT'; | ||
import { pipeable } from 'fp-ts/es6/pipeable'; | ||
const T = getOptionM(array); | ||
@@ -5,0 +5,0 @@ /** |
@@ -1,3 +0,3 @@ | ||
import { HKT, Kind, Kind2, Kind3, URIS, URIS2, URIS3 } from 'fp-ts/lib/HKT'; | ||
import { Monad, Monad1, Monad2, Monad2C, Monad3 } from 'fp-ts/lib/Monad'; | ||
import { HKT, Kind, Kind2, Kind3, URIS, URIS2, URIS3 } from 'fp-ts/es6/HKT'; | ||
import { Monad, Monad1, Monad2, Monad2C, Monad3 } from 'fp-ts/es6/Monad'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Like `array.traverse` but actions are batched in chunks. |
@@ -1,2 +0,2 @@ | ||
import { array } from 'fp-ts/lib/Array'; | ||
import { array } from 'fp-ts/es6/Array'; | ||
export function batchTraverse(M) { | ||
@@ -3,0 +3,0 @@ const traverseM = array.traverse(M); |
@@ -1,5 +0,5 @@ | ||
import { Alt, Alt1, Alt2 } from 'fp-ts/lib/Alt'; | ||
import { HKT, Kind, Kind2, URIS, URIS2 } from 'fp-ts/lib/HKT'; | ||
import { Monad, Monad1, Monad2 } from 'fp-ts/lib/Monad'; | ||
import { Option } from 'fp-ts/lib/Option'; | ||
import { Alt, Alt1, Alt2 } from 'fp-ts/es6/Alt'; | ||
import { HKT, Kind, Kind2, URIS, URIS2 } from 'fp-ts/es6/HKT'; | ||
import { Monad, Monad1, Monad2 } from 'fp-ts/es6/Monad'; | ||
import { Option } from 'fp-ts/es6/Option'; | ||
/** | ||
@@ -10,8 +10,8 @@ * Execute an action repeatedly until the `Option` condition returns a `Some`. Collects results into an arbitrary `Alt` | ||
* @example | ||
* import { array } from 'fp-ts/lib/Array' | ||
* import * as E from 'fp-ts/lib/Either' | ||
* import { flow } from 'fp-ts/lib/function' | ||
* import * as O from 'fp-ts/lib/Option' | ||
* import * as TE from 'fp-ts/lib/TaskEither' | ||
* import { collectUntil } from 'fp-ts-contrib/lib/collectUntil' | ||
* import { array } from 'fp-ts/es6/Array' | ||
* import * as E from 'fp-ts/es6/Either' | ||
* import { flow } from 'fp-ts/es6/function' | ||
* import * as O from 'fp-ts/es6/Option' | ||
* import * as TE from 'fp-ts/es6/TaskEither' | ||
* import { collectUntil } from 'fp-ts-contrib/es6/collectUntil' | ||
* | ||
@@ -18,0 +18,0 @@ * interface Page { |
@@ -1,4 +0,4 @@ | ||
import { flow } from 'fp-ts/lib/function'; | ||
import { fold } from 'fp-ts/lib/Option'; | ||
import { pipe } from 'fp-ts/lib/pipeable'; | ||
import { flow } from 'fp-ts/es6/function'; | ||
import { fold } from 'fp-ts/es6/Option'; | ||
import { pipe } from 'fp-ts/es6/pipeable'; | ||
export function collectUntil(M, F) { | ||
@@ -5,0 +5,0 @@ return (f) => { |
140
es6/Do.d.ts
@@ -1,3 +0,3 @@ | ||
import { HKT, Kind, Kind2, Kind3, URIS, URIS2, URIS3 } from 'fp-ts/lib/HKT'; | ||
import { Monad, Monad1, Monad2, Monad2C, Monad3 } from 'fp-ts/lib/Monad'; | ||
import { HKT, Kind, Kind2, Kind3, URIS, URIS2, URIS3 } from 'fp-ts/es6/HKT'; | ||
import { Monad, Monad1, Monad2, Monad2C, Monad3 } from 'fp-ts/es6/Monad'; | ||
declare type EnforceNonEmptyRecord<R> = keyof R extends never ? never : R; | ||
@@ -8,22 +8,22 @@ /** | ||
export interface Do3<M extends URIS3, S extends object> { | ||
do: <U, L>(ma: Kind3<M, U, L, unknown>) => Do3C<M, S, U, L>; | ||
doL: <U, L>(f: (s: S) => Kind3<M, U, L, unknown>) => Do3C<M, S, U, L>; | ||
bind: <N extends string, A, U, L>(name: Exclude<N, keyof S>, ma: Kind3<M, U, L, A>) => Do3C<M, S & { | ||
do: <R, E>(ma: Kind3<M, R, E, any>) => Do3C<M, S, R, E>; | ||
doL: <R, E>(f: (s: S) => Kind3<M, R, E, any>) => Do3C<M, S, R, E>; | ||
bind: <N extends string, A, R, E>(name: Exclude<N, keyof S>, ma: Kind3<M, R, E, A>) => Do3C<M, S & { | ||
[K in N]: A; | ||
}, U, L>; | ||
bindL: <N extends string, A, U, L>(name: Exclude<N, keyof S>, f: (s: S) => Kind3<M, U, L, A>) => Do3C<M, S & { | ||
}, R, E>; | ||
bindL: <N extends string, A, R, E>(name: Exclude<N, keyof S>, f: (s: S) => Kind3<M, R, E, A>) => Do3C<M, S & { | ||
[K in N]: A; | ||
}, U, L>; | ||
sequenceS: <U, L, R extends Record<string, Kind3<M, U, L, any>>>(r: EnforceNonEmptyRecord<R> & Record<string, Kind3<M, U, L, any>> & { | ||
}, R, E>; | ||
sequenceS: <R, E, I extends Record<string, Kind3<M, R, E, any>>>(r: EnforceNonEmptyRecord<I> & Record<string, Kind3<M, R, E, any>> & { | ||
[K in keyof S]?: never; | ||
}) => Do3C<M, S & { | ||
[K in keyof R]: [R[K]] extends [Kind3<M, any, any, infer A>] ? A : never; | ||
}, U, L>; | ||
sequenceSL: <U, L, R extends Record<string, Kind3<M, U, L, any>>>(f: (s: S) => EnforceNonEmptyRecord<R> & Record<string, Kind3<M, U, L, any>> & { | ||
[K in keyof I]: [I[K]] extends [Kind3<M, any, any, infer A>] ? A : never; | ||
}, R, E>; | ||
sequenceSL: <R, E, I extends Record<string, Kind3<M, R, E, any>>>(f: (s: S) => EnforceNonEmptyRecord<I> & Record<string, Kind3<M, R, E, any>> & { | ||
[K in keyof S]?: never; | ||
}) => Do3C<M, S & { | ||
[K in keyof R]: [R[K]] extends [Kind3<M, any, any, infer A>] ? A : never; | ||
}, U, L>; | ||
return: <A, U, L>(f: (s: S) => A) => Kind3<M, U, L, A>; | ||
done: <U, L>() => Kind3<M, U, L, S>; | ||
[K in keyof I]: [I[K]] extends [Kind3<M, any, any, infer A>] ? A : never; | ||
}, R, E>; | ||
return: <R, E, A>(f: (s: S) => A) => Kind3<M, R, E, A>; | ||
done: <R, E>() => Kind3<M, R, E, S>; | ||
} | ||
@@ -33,23 +33,23 @@ /** | ||
*/ | ||
export interface Do3C<M extends URIS3, S extends object, U, L> { | ||
do: (ma: Kind3<M, U, L, unknown>) => Do3C<M, S, U, L>; | ||
doL: (f: (s: S) => Kind3<M, U, L, unknown>) => Do3C<M, S, U, L>; | ||
bind: <N extends string, A>(name: Exclude<N, keyof S>, ma: Kind3<M, U, L, A>) => Do3C<M, S & { | ||
export interface Do3C<M extends URIS3, S extends object, R, E> { | ||
do: (ma: Kind3<M, R, E, any>) => Do3C<M, S, R, E>; | ||
doL: (f: (s: S) => Kind3<M, R, E, any>) => Do3C<M, S, R, E>; | ||
bind: <N extends string, A>(name: Exclude<N, keyof S>, ma: Kind3<M, R, E, A>) => Do3C<M, S & { | ||
[K in N]: A; | ||
}, U, L>; | ||
bindL: <N extends string, A>(name: Exclude<N, keyof S>, f: (s: S) => Kind3<M, U, L, A>) => Do3C<M, S & { | ||
}, R, E>; | ||
bindL: <N extends string, A>(name: Exclude<N, keyof S>, f: (s: S) => Kind3<M, R, E, A>) => Do3C<M, S & { | ||
[K in N]: A; | ||
}, U, L>; | ||
sequenceS: <R extends Record<string, Kind3<M, U, L, any>>>(r: EnforceNonEmptyRecord<R> & { | ||
}, R, E>; | ||
sequenceS: <I extends Record<string, Kind3<M, R, E, any>>>(r: EnforceNonEmptyRecord<I> & { | ||
[K in keyof S]?: never; | ||
}) => Do3C<M, S & { | ||
[K in keyof R]: [R[K]] extends [Kind3<M, any, any, infer A>] ? A : never; | ||
}, U, L>; | ||
sequenceSL: <R extends Record<string, Kind3<M, U, L, any>>>(f: (s: S) => EnforceNonEmptyRecord<R> & { | ||
[K in keyof I]: [I[K]] extends [Kind3<M, any, any, infer A>] ? A : never; | ||
}, R, E>; | ||
sequenceSL: <I extends Record<string, Kind3<M, R, E, any>>>(f: (s: S) => EnforceNonEmptyRecord<I> & { | ||
[K in keyof S]?: never; | ||
}) => Do3C<M, S & { | ||
[K in keyof R]: [R[K]] extends [Kind3<M, any, any, infer A>] ? A : never; | ||
}, U, L>; | ||
return: <A>(f: (s: S) => A) => Kind3<M, U, L, A>; | ||
done: () => Kind3<M, U, L, S>; | ||
[K in keyof I]: [I[K]] extends [Kind3<M, any, any, infer A>] ? A : never; | ||
}, R, E>; | ||
return: <A>(f: (s: S) => A) => Kind3<M, R, E, A>; | ||
done: () => Kind3<M, R, E, S>; | ||
} | ||
@@ -60,22 +60,22 @@ /** | ||
export interface Do2<M extends URIS2, S extends object> { | ||
do: <L>(ma: Kind2<M, L, unknown>) => Do2C<M, S, L>; | ||
doL: <L>(f: (s: S) => Kind2<M, L, unknown>) => Do2C<M, S, L>; | ||
bind: <N extends string, A, L>(name: Exclude<N, keyof S>, ma: Kind2<M, L, A>) => Do2C<M, S & { | ||
do: <E>(ma: Kind2<M, E, any>) => Do2C<M, S, E>; | ||
doL: <E>(f: (s: S) => Kind2<M, E, any>) => Do2C<M, S, E>; | ||
bind: <N extends string, A, E>(name: Exclude<N, keyof S>, ma: Kind2<M, E, A>) => Do2C<M, S & { | ||
[K in N]: A; | ||
}, L>; | ||
bindL: <N extends string, A, L>(name: Exclude<N, keyof S>, f: (s: S) => Kind2<M, L, A>) => Do2C<M, S & { | ||
}, E>; | ||
bindL: <N extends string, A, E>(name: Exclude<N, keyof S>, f: (s: S) => Kind2<M, E, A>) => Do2C<M, S & { | ||
[K in N]: A; | ||
}, L>; | ||
sequenceS: <L, R extends Record<string, Kind2<M, L, any>>>(r: EnforceNonEmptyRecord<R> & Record<string, Kind2<M, L, any>> & { | ||
}, E>; | ||
sequenceS: <E, I extends Record<string, Kind2<M, E, any>>>(r: EnforceNonEmptyRecord<I> & Record<string, Kind2<M, E, any>> & { | ||
[K in keyof S]?: never; | ||
}) => Do2C<M, S & { | ||
[K in keyof R]: [R[K]] extends [Kind2<M, any, infer A>] ? A : never; | ||
}, L>; | ||
sequenceSL: <L, R extends Record<string, Kind2<M, L, any>>>(f: (s: S) => EnforceNonEmptyRecord<R> & Record<string, Kind2<M, L, any>> & { | ||
[K in keyof I]: [I[K]] extends [Kind2<M, any, infer A>] ? A : never; | ||
}, E>; | ||
sequenceSL: <E, I extends Record<string, Kind2<M, E, any>>>(f: (s: S) => EnforceNonEmptyRecord<I> & Record<string, Kind2<M, E, any>> & { | ||
[K in keyof S]?: never; | ||
}) => Do2C<M, S & { | ||
[K in keyof R]: [R[K]] extends [Kind2<M, any, infer A>] ? A : never; | ||
}, L>; | ||
return: <A, L>(f: (s: S) => A) => Kind2<M, L, A>; | ||
done: <L>() => Kind2<M, L, S>; | ||
[K in keyof I]: [I[K]] extends [Kind2<M, any, infer A>] ? A : never; | ||
}, E>; | ||
return: <E, A>(f: (s: S) => A) => Kind2<M, E, A>; | ||
done: <E>() => Kind2<M, E, S>; | ||
} | ||
@@ -85,23 +85,23 @@ /** | ||
*/ | ||
export interface Do2C<M extends URIS2, S extends object, L> { | ||
do: (ma: Kind2<M, L, unknown>) => Do2C<M, S, L>; | ||
doL: (f: (s: S) => Kind2<M, L, unknown>) => Do2C<M, S, L>; | ||
bind: <N extends string, A>(name: Exclude<N, keyof S>, ma: Kind2<M, L, A>) => Do2C<M, S & { | ||
export interface Do2C<M extends URIS2, S extends object, E> { | ||
do: (ma: Kind2<M, E, any>) => Do2C<M, S, E>; | ||
doL: (f: (s: S) => Kind2<M, E, any>) => Do2C<M, S, E>; | ||
bind: <N extends string, A>(name: Exclude<N, keyof S>, ma: Kind2<M, E, A>) => Do2C<M, S & { | ||
[K in N]: A; | ||
}, L>; | ||
bindL: <N extends string, A>(name: Exclude<N, keyof S>, f: (s: S) => Kind2<M, L, A>) => Do2C<M, S & { | ||
}, E>; | ||
bindL: <N extends string, A>(name: Exclude<N, keyof S>, f: (s: S) => Kind2<M, E, A>) => Do2C<M, S & { | ||
[K in N]: A; | ||
}, L>; | ||
sequenceS: <R extends Record<string, Kind2<M, L, any>>>(r: EnforceNonEmptyRecord<R> & { | ||
}, E>; | ||
sequenceS: <I extends Record<string, Kind2<M, E, any>>>(r: EnforceNonEmptyRecord<I> & { | ||
[K in keyof S]?: never; | ||
}) => Do2C<M, S & { | ||
[K in keyof R]: [R[K]] extends [Kind2<M, any, infer A>] ? A : never; | ||
}, L>; | ||
sequenceSL: <R extends Record<string, Kind2<M, L, any>>>(f: (s: S) => EnforceNonEmptyRecord<R> & { | ||
[K in keyof I]: [I[K]] extends [Kind2<M, any, infer A>] ? A : never; | ||
}, E>; | ||
sequenceSL: <I extends Record<string, Kind2<M, E, any>>>(f: (s: S) => EnforceNonEmptyRecord<I> & { | ||
[K in keyof S]?: never; | ||
}) => Do2C<M, S & { | ||
[K in keyof R]: [R[K]] extends [Kind2<M, any, infer A>] ? A : never; | ||
}, L>; | ||
return: <A>(f: (s: S) => A) => Kind2<M, L, A>; | ||
done: () => Kind2<M, L, S>; | ||
[K in keyof I]: [I[K]] extends [Kind2<M, any, infer A>] ? A : never; | ||
}, E>; | ||
return: <A>(f: (s: S) => A) => Kind2<M, E, A>; | ||
done: () => Kind2<M, E, S>; | ||
} | ||
@@ -112,4 +112,4 @@ /** | ||
export interface Do1<M extends URIS, S extends object> { | ||
do: (ma: Kind<M, unknown>) => Do1<M, S>; | ||
doL: (f: (s: S) => Kind<M, unknown>) => Do1<M, S>; | ||
do: (ma: Kind<M, any>) => Do1<M, S>; | ||
doL: (f: (s: S) => Kind<M, any>) => Do1<M, S>; | ||
bind: <N extends string, A>(name: Exclude<N, keyof S>, ma: Kind<M, A>) => Do1<M, S & { | ||
@@ -126,6 +126,6 @@ [K in N]: A; | ||
}>; | ||
sequenceSL: <R extends Record<string, Kind<M, any>>>(f: (s: S) => EnforceNonEmptyRecord<R> & { | ||
sequenceSL: <I extends Record<string, Kind<M, any>>>(f: (s: S) => EnforceNonEmptyRecord<I> & { | ||
[K in keyof S]?: never; | ||
}) => Do1<M, S & { | ||
[K in keyof R]: [R[K]] extends [Kind<M, infer A>] ? A : never; | ||
[K in keyof I]: [I[K]] extends [Kind<M, infer A>] ? A : never; | ||
}>; | ||
@@ -139,4 +139,4 @@ return: <A>(f: (s: S) => A) => Kind<M, A>; | ||
export interface Do0<M, S extends object> { | ||
do: (ma: HKT<M, unknown>) => Do0<M, S>; | ||
doL: (f: (s: S) => HKT<M, unknown>) => Do0<M, S>; | ||
do: (ma: HKT<M, any>) => Do0<M, S>; | ||
doL: (f: (s: S) => HKT<M, any>) => Do0<M, S>; | ||
bind: <N extends string, A>(name: Exclude<N, keyof S>, ma: HKT<M, A>) => Do0<M, S & { | ||
@@ -148,3 +148,3 @@ [K in N]: A; | ||
}>; | ||
sequenceS: <R extends Record<string, HKT<M, unknown>>>(r: EnforceNonEmptyRecord<R> & { | ||
sequenceS: <R extends Record<string, HKT<M, any>>>(r: EnforceNonEmptyRecord<R> & { | ||
[K in keyof S]?: never; | ||
@@ -154,3 +154,3 @@ }) => Do0<M, S & { | ||
}>; | ||
sequenceSL: <R extends Record<string, HKT<M, unknown>>>(f: (s: S) => EnforceNonEmptyRecord<R> & { | ||
sequenceSL: <R extends Record<string, HKT<M, any>>>(f: (s: S) => EnforceNonEmptyRecord<R> & { | ||
[K in keyof S]?: never; | ||
@@ -170,4 +170,4 @@ }) => Do0<M, S & { | ||
* @example | ||
* import { option, some } from 'fp-ts/lib/Option' | ||
* import { Do } from 'fp-ts-contrib/lib/Do' | ||
* import { option, some } from 'fp-ts/es6/Option' | ||
* import { Do } from 'fp-ts-contrib/es6/Do' | ||
* | ||
@@ -174,0 +174,0 @@ * // x: Option<number> |
/** | ||
* @file This module provides a simuation of Haskell do notation. | ||
*/ | ||
import { sequenceS } from 'fp-ts/lib/Apply'; | ||
import { sequenceS } from 'fp-ts/es6/Apply'; | ||
class DoClass { | ||
@@ -6,0 +6,0 @@ constructor(M, result) { |
@@ -1,3 +0,3 @@ | ||
import { HKT, Kind, Kind2, Kind3, URIS, URIS2, URIS3 } from 'fp-ts/lib/HKT'; | ||
import { Monad, Monad1, Monad2, Monad2C, Monad3 } from 'fp-ts/lib/Monad'; | ||
import { HKT, Kind, Kind2, Kind3, URIS, URIS2, URIS3 } from 'fp-ts/es6/HKT'; | ||
import { Monad, Monad1, Monad2, Monad2C, Monad3 } from 'fp-ts/es6/Monad'; | ||
/** | ||
@@ -11,3 +11,3 @@ * @since 0.1.3 | ||
export declare type URI = typeof URI; | ||
declare module 'fp-ts/lib/HKT' { | ||
declare module 'fp-ts/es6/HKT' { | ||
interface URItoKind2<E, A> { | ||
@@ -14,0 +14,0 @@ Free: Free<E, A>; |
@@ -1,2 +0,2 @@ | ||
import { pipeable } from 'fp-ts/lib/pipeable'; | ||
import { pipeable } from 'fp-ts/es6/pipeable'; | ||
/** | ||
@@ -3,0 +3,0 @@ * @since 0.1.3 |
/** | ||
* @file Adapted from https://github.com/purescript/purescript-lists | ||
*/ | ||
import { Foldable1 } from 'fp-ts/lib/Foldable'; | ||
import { Functor1 } from 'fp-ts/lib/Functor'; | ||
import { Traversable1 } from 'fp-ts/lib/Traversable'; | ||
import * as O from 'fp-ts/lib/Option'; | ||
import { Predicate, Refinement } from 'fp-ts/lib/function'; | ||
import * as Eq from 'fp-ts/lib/Eq'; | ||
declare module 'fp-ts/lib/HKT' { | ||
import { Foldable1 } from 'fp-ts/es6/Foldable'; | ||
import { Functor1 } from 'fp-ts/es6/Functor'; | ||
import { Traversable1 } from 'fp-ts/es6/Traversable'; | ||
import * as O from 'fp-ts/es6/Option'; | ||
import { Predicate, Refinement } from 'fp-ts/es6/function'; | ||
import * as Eq from 'fp-ts/es6/Eq'; | ||
declare module 'fp-ts/es6/HKT' { | ||
interface URItoKind<A> { | ||
@@ -51,3 +51,3 @@ List: List<A>; | ||
* @example | ||
* import * as L from 'fp-ts-contrib/lib/List' | ||
* import * as L from 'fp-ts-contrib/es6/List' | ||
* | ||
@@ -63,3 +63,3 @@ * assert.deepStrictEqual(L.cons('a', L.nil), { type: 'Cons', head: 'a', tail: L.nil, length: 1 }) | ||
* @example | ||
* import * as L from 'fp-ts-contrib/lib/List' | ||
* import * as L from 'fp-ts-contrib/es6/List' | ||
* | ||
@@ -75,3 +75,3 @@ * assert.deepStrictEqual(L.of('a'), L.cons('a', L.nil)) | ||
* @example | ||
* import * as L from 'fp-ts-contrib/lib/List' | ||
* import * as L from 'fp-ts-contrib/es6/List' | ||
* | ||
@@ -88,3 +88,3 @@ * assert.strictEqual(L.isNil(L.nil), true) | ||
* @example | ||
* import * as L from 'fp-ts-contrib/lib/List' | ||
* import * as L from 'fp-ts-contrib/es6/List' | ||
* | ||
@@ -101,4 +101,4 @@ * assert.strictEqual(L.isCons(L.nil), false) | ||
* @example | ||
* import * as O from 'fp-ts/lib/Option' | ||
* import * as L from 'fp-ts-contrib/lib/List' | ||
* import * as O from 'fp-ts/es6/Option' | ||
* import * as L from 'fp-ts-contrib/es6/List' | ||
* | ||
@@ -115,4 +115,4 @@ * assert.deepStrictEqual(L.head(L.nil), O.none) | ||
* @example | ||
* import * as O from 'fp-ts/lib/Option' | ||
* import * as L from 'fp-ts-contrib/lib/List' | ||
* import * as O from 'fp-ts/es6/Option' | ||
* import * as L from 'fp-ts-contrib/es6/List' | ||
* | ||
@@ -130,3 +130,3 @@ * assert.deepStrictEqual(L.tail(L.nil), O.none) | ||
* @example | ||
* import * as L from 'fp-ts-contrib/lib/List' | ||
* import * as L from 'fp-ts-contrib/es6/List' | ||
* | ||
@@ -145,4 +145,4 @@ * const len: <A>(as: L.List<A>) => number = L.foldLeft( | ||
* @example | ||
* import * as O from 'fp-ts/lib/Option' | ||
* import * as L from 'fp-ts-contrib/lib/List' | ||
* import * as O from 'fp-ts/es6/Option' | ||
* import * as L from 'fp-ts-contrib/es6/List' | ||
* | ||
@@ -162,3 +162,3 @@ * const f = (a: number): boolean => a % 2 === 0 | ||
* @example | ||
* import * as L from 'fp-ts-contrib/lib/List' | ||
* import * as L from 'fp-ts-contrib/es6/List' | ||
* | ||
@@ -174,3 +174,3 @@ * assert.deepStrictEqual(L.reverse(L.cons(1, L.cons(2, L.of(3)))), L.cons(3, L.cons(2, L.of(1)))) | ||
* @example | ||
* import * as L from 'fp-ts-contrib/lib/List' | ||
* import * as L from 'fp-ts-contrib/es6/List' | ||
* | ||
@@ -188,3 +188,3 @@ * assert.deepStrictEqual(L.dropLeft(1)(L.nil), L.nil) | ||
* @example | ||
* import * as L from 'fp-ts-contrib/lib/List' | ||
* import * as L from 'fp-ts-contrib/es6/List' | ||
* | ||
@@ -204,3 +204,3 @@ * const isLTThree = (n: number) => n < 3 | ||
* @example | ||
* import * as L from 'fp-ts-contrib/lib/List' | ||
* import * as L from 'fp-ts-contrib/es6/List' | ||
* | ||
@@ -216,3 +216,3 @@ * assert.deepStrictEqual(L.toArray(L.cons('a', L.of('b'))), ['a', 'b']) | ||
* @example | ||
* import * as L from 'fp-ts-contrib/lib/List' | ||
* import * as L from 'fp-ts-contrib/es6/List' | ||
* | ||
@@ -228,3 +228,3 @@ * assert.deepStrictEqual(L.toReversedArray(L.cons('a', L.of('b'))), ['b', 'a']) | ||
* @example | ||
* import * as L from 'fp-ts-contrib/lib/List' | ||
* import * as L from 'fp-ts-contrib/es6/List' | ||
* | ||
@@ -244,4 +244,4 @@ * assert.deepStrictEqual(L.fromArray([]), L.nil) | ||
* @example | ||
* import { eqString } from 'fp-ts/lib/Eq' | ||
* import * as L from 'fp-ts-contrib/lib/List' | ||
* import { eqString } from 'fp-ts/es6/Eq' | ||
* import * as L from 'fp-ts-contrib/es6/List' | ||
* | ||
@@ -248,0 +248,0 @@ * const E = L.getEq(eqString) |
/** | ||
* @file Adapted from https://github.com/purescript/purescript-lists | ||
*/ | ||
import * as A from 'fp-ts/lib/Array'; | ||
import * as O from 'fp-ts/lib/Option'; | ||
import { pipeable } from 'fp-ts/lib/pipeable'; | ||
import * as A from 'fp-ts/es6/Array'; | ||
import * as O from 'fp-ts/es6/Option'; | ||
import { pipeable } from 'fp-ts/es6/pipeable'; | ||
/** | ||
@@ -19,3 +19,3 @@ * @since 0.1.8 | ||
* @example | ||
* import * as L from 'fp-ts-contrib/lib/List' | ||
* import * as L from 'fp-ts-contrib/es6/List' | ||
* | ||
@@ -33,3 +33,3 @@ * assert.deepStrictEqual(L.cons('a', L.nil), { type: 'Cons', head: 'a', tail: L.nil, length: 1 }) | ||
* @example | ||
* import * as L from 'fp-ts-contrib/lib/List' | ||
* import * as L from 'fp-ts-contrib/es6/List' | ||
* | ||
@@ -47,3 +47,3 @@ * assert.deepStrictEqual(L.of('a'), L.cons('a', L.nil)) | ||
* @example | ||
* import * as L from 'fp-ts-contrib/lib/List' | ||
* import * as L from 'fp-ts-contrib/es6/List' | ||
* | ||
@@ -62,3 +62,3 @@ * assert.strictEqual(L.isNil(L.nil), true) | ||
* @example | ||
* import * as L from 'fp-ts-contrib/lib/List' | ||
* import * as L from 'fp-ts-contrib/es6/List' | ||
* | ||
@@ -77,4 +77,4 @@ * assert.strictEqual(L.isCons(L.nil), false) | ||
* @example | ||
* import * as O from 'fp-ts/lib/Option' | ||
* import * as L from 'fp-ts-contrib/lib/List' | ||
* import * as O from 'fp-ts/es6/Option' | ||
* import * as L from 'fp-ts-contrib/es6/List' | ||
* | ||
@@ -93,4 +93,4 @@ * assert.deepStrictEqual(L.head(L.nil), O.none) | ||
* @example | ||
* import * as O from 'fp-ts/lib/Option' | ||
* import * as L from 'fp-ts-contrib/lib/List' | ||
* import * as O from 'fp-ts/es6/Option' | ||
* import * as L from 'fp-ts-contrib/es6/List' | ||
* | ||
@@ -110,3 +110,3 @@ * assert.deepStrictEqual(L.tail(L.nil), O.none) | ||
* @example | ||
* import * as L from 'fp-ts-contrib/lib/List' | ||
* import * as L from 'fp-ts-contrib/es6/List' | ||
* | ||
@@ -127,4 +127,4 @@ * const len: <A>(as: L.List<A>) => number = L.foldLeft( | ||
* @example | ||
* import * as O from 'fp-ts/lib/Option' | ||
* import * as L from 'fp-ts-contrib/lib/List' | ||
* import * as O from 'fp-ts/es6/Option' | ||
* import * as L from 'fp-ts-contrib/es6/List' | ||
* | ||
@@ -156,3 +156,3 @@ * const f = (a: number): boolean => a % 2 === 0 | ||
* @example | ||
* import * as L from 'fp-ts-contrib/lib/List' | ||
* import * as L from 'fp-ts-contrib/es6/List' | ||
* | ||
@@ -176,3 +176,3 @@ * assert.deepStrictEqual(L.reverse(L.cons(1, L.cons(2, L.of(3)))), L.cons(3, L.cons(2, L.of(1)))) | ||
* @example | ||
* import * as L from 'fp-ts-contrib/lib/List' | ||
* import * as L from 'fp-ts-contrib/es6/List' | ||
* | ||
@@ -213,3 +213,3 @@ * assert.deepStrictEqual(L.dropLeft(1)(L.nil), L.nil) | ||
* @example | ||
* import * as L from 'fp-ts-contrib/lib/List' | ||
* import * as L from 'fp-ts-contrib/es6/List' | ||
* | ||
@@ -234,3 +234,3 @@ * assert.deepStrictEqual(L.toArray(L.cons('a', L.of('b'))), ['a', 'b']) | ||
* @example | ||
* import * as L from 'fp-ts-contrib/lib/List' | ||
* import * as L from 'fp-ts-contrib/es6/List' | ||
* | ||
@@ -255,3 +255,3 @@ * assert.deepStrictEqual(L.toReversedArray(L.cons('a', L.of('b'))), ['b', 'a']) | ||
* @example | ||
* import * as L from 'fp-ts-contrib/lib/List' | ||
* import * as L from 'fp-ts-contrib/es6/List' | ||
* | ||
@@ -273,4 +273,4 @@ * assert.deepStrictEqual(L.fromArray([]), L.nil) | ||
* @example | ||
* import { eqString } from 'fp-ts/lib/Eq' | ||
* import * as L from 'fp-ts-contrib/lib/List' | ||
* import { eqString } from 'fp-ts/es6/Eq' | ||
* import * as L from 'fp-ts-contrib/es6/List' | ||
* | ||
@@ -277,0 +277,0 @@ * const E = L.getEq(eqString) |
@@ -1,6 +0,6 @@ | ||
import * as I from 'fp-ts/lib/IO'; | ||
import { Monad2 } from 'fp-ts/lib/Monad'; | ||
import { Reader } from 'fp-ts/lib/Reader'; | ||
import * as I from 'fp-ts/es6/IO'; | ||
import { Monad2 } from 'fp-ts/es6/Monad'; | ||
import { Reader } from 'fp-ts/es6/Reader'; | ||
import IO = I.IO; | ||
declare module 'fp-ts/lib/HKT' { | ||
declare module 'fp-ts/es6/HKT' { | ||
interface URItoKind2<E, A> { | ||
@@ -7,0 +7,0 @@ ReaderIO: ReaderIO<E, A>; |
@@ -1,4 +0,4 @@ | ||
import * as I from 'fp-ts/lib/IO'; | ||
import { pipeable } from 'fp-ts/lib/pipeable'; | ||
import { getReaderM } from 'fp-ts/lib/ReaderT'; | ||
import * as I from 'fp-ts/es6/IO'; | ||
import { pipeable } from 'fp-ts/es6/pipeable'; | ||
import { getReaderM } from 'fp-ts/es6/ReaderT'; | ||
const T = getReaderM(I.io); | ||
@@ -5,0 +5,0 @@ /** |
@@ -6,5 +6,5 @@ /** | ||
*/ | ||
import * as O from 'fp-ts/lib/Option'; | ||
import { Predicate } from 'fp-ts/lib/function'; | ||
import { NonEmptyArray } from 'fp-ts/lib/NonEmptyArray'; | ||
import * as O from 'fp-ts/es6/Option'; | ||
import { Predicate } from 'fp-ts/es6/function'; | ||
import { NonEmptyArray } from 'fp-ts/es6/NonEmptyArray'; | ||
/** | ||
@@ -14,5 +14,5 @@ * Returns the list of subexpression matches, or `None` if the match fails. | ||
* @example | ||
* import * as O from 'fp-ts/lib/Option' | ||
* import { match } from 'fp-ts-contrib/lib/RegExp' | ||
* import { pipe } from 'fp-ts/lib/pipeable' | ||
* import * as O from 'fp-ts/es6/Option' | ||
* import { match } from 'fp-ts-contrib/es6/RegExp' | ||
* import { pipe } from 'fp-ts/es6/pipeable' | ||
* | ||
@@ -31,3 +31,3 @@ * const myMatch = match(/^(\d)(\w)$/) | ||
* @example | ||
* import { test } from 'fp-ts-contrib/lib/RegExp' | ||
* import { test } from 'fp-ts-contrib/es6/RegExp' | ||
* | ||
@@ -46,3 +46,3 @@ * const myTest = test(/^(\d)(\w)$/) | ||
* @example | ||
* import { sub } from 'fp-ts-contrib/lib/RegExp' | ||
* import { sub } from 'fp-ts-contrib/es6/RegExp' | ||
* | ||
@@ -60,3 +60,3 @@ * const sanitiseSpaces = sub(/\s/g, '_') | ||
* @example | ||
* import { split } from 'fp-ts-contrib/lib/RegExp' | ||
* import { split } from 'fp-ts-contrib/es6/RegExp' | ||
* | ||
@@ -63,0 +63,0 @@ * const splitByHash = split(/#/) |
@@ -6,3 +6,3 @@ /** | ||
*/ | ||
import * as O from 'fp-ts/lib/Option'; | ||
import * as O from 'fp-ts/es6/Option'; | ||
/** | ||
@@ -12,5 +12,5 @@ * Returns the list of subexpression matches, or `None` if the match fails. | ||
* @example | ||
* import * as O from 'fp-ts/lib/Option' | ||
* import { match } from 'fp-ts-contrib/lib/RegExp' | ||
* import { pipe } from 'fp-ts/lib/pipeable' | ||
* import * as O from 'fp-ts/es6/Option' | ||
* import { match } from 'fp-ts-contrib/es6/RegExp' | ||
* import { pipe } from 'fp-ts/es6/pipeable' | ||
* | ||
@@ -31,3 +31,3 @@ * const myMatch = match(/^(\d)(\w)$/) | ||
* @example | ||
* import { test } from 'fp-ts-contrib/lib/RegExp' | ||
* import { test } from 'fp-ts-contrib/es6/RegExp' | ||
* | ||
@@ -48,3 +48,3 @@ * const myTest = test(/^(\d)(\w)$/) | ||
* @example | ||
* import { sub } from 'fp-ts-contrib/lib/RegExp' | ||
* import { sub } from 'fp-ts-contrib/es6/RegExp' | ||
* | ||
@@ -64,3 +64,3 @@ * const sanitiseSpaces = sub(/\s/g, '_') | ||
* @example | ||
* import { split } from 'fp-ts-contrib/lib/RegExp' | ||
* import { split } from 'fp-ts-contrib/es6/RegExp' | ||
* | ||
@@ -67,0 +67,0 @@ * const splitByHash = split(/#/) |
@@ -17,5 +17,5 @@ /** | ||
*/ | ||
import { Functor, Functor1, Functor2, Functor2C, Functor3 } from 'fp-ts/lib/Functor'; | ||
import { HKT, Kind, Kind2, Kind3, URIS, URIS2, URIS3 } from 'fp-ts/lib/HKT'; | ||
import { These } from 'fp-ts/lib/These'; | ||
import { Functor, Functor1, Functor2, Functor2C, Functor3 } from 'fp-ts/es6/Functor'; | ||
import { HKT, Kind, Kind2, Kind3, URIS, URIS2, URIS3 } from 'fp-ts/es6/HKT'; | ||
import { These } from 'fp-ts/es6/These'; | ||
/** | ||
@@ -22,0 +22,0 @@ * @since 0.1.0 |
@@ -1,2 +0,2 @@ | ||
import { URI } from 'fp-ts/lib/NonEmptyArray'; | ||
import { URI } from 'fp-ts/es6/NonEmptyArray'; | ||
import { Semialign1 } from './'; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,3 +0,3 @@ | ||
import { nonEmptyArray, URI, cons, head, tail } from 'fp-ts/lib/NonEmptyArray'; | ||
import { both } from 'fp-ts/lib/These'; | ||
import { nonEmptyArray, URI, cons, head, tail } from 'fp-ts/es6/NonEmptyArray'; | ||
import { both } from 'fp-ts/es6/These'; | ||
import { alignArray } from '../Align/Array'; | ||
@@ -17,5 +17,5 @@ /** | ||
* @example | ||
* import { These } from 'fp-ts/lib/These' | ||
* import { identity } from 'fp-ts/lib/function' | ||
* import { alignNonEmptyArray } from 'fp-ts-contrib/lib/Semialign/NonEmptyArray' | ||
* import { These } from 'fp-ts/es6/These' | ||
* import { identity } from 'fp-ts/es6/function' | ||
* import { alignNonEmptyArray } from 'fp-ts-contrib/es6/Semialign/NonEmptyArray' | ||
* | ||
@@ -37,5 +37,5 @@ * const f = (x: These<number, string>) => x.fold(a => a.toString(), identity, (a, b) => a + b) | ||
* @example | ||
* import { These } from 'fp-ts/lib/These' | ||
* import { identity } from 'fp-ts/lib/function' | ||
* import { alignNonEmptyArray } from 'fp-ts-contrib/lib/Semialign/NonEmptyArray' | ||
* import { These } from 'fp-ts/es6/These' | ||
* import { identity } from 'fp-ts/es6/function' | ||
* import { alignNonEmptyArray } from 'fp-ts-contrib/es6/Semialign/NonEmptyArray' | ||
* | ||
@@ -42,0 +42,0 @@ * assert.deepStrictEqual(semialignNonEmptyArray.align(new NonEmptyArray(1, [2, 3]), new NonEmptyArray('a', ['b', 'c']), new NonEmptyArray(both(1, 'a'), [both(2, 'b'), both(3, 'c')])) |
@@ -1,6 +0,6 @@ | ||
import * as I from 'fp-ts/lib/IO'; | ||
import { Monad2 } from 'fp-ts/lib/Monad'; | ||
import { State } from 'fp-ts/lib/State'; | ||
import * as I from 'fp-ts/es6/IO'; | ||
import { Monad2 } from 'fp-ts/es6/Monad'; | ||
import { State } from 'fp-ts/es6/State'; | ||
import IO = I.IO; | ||
declare module 'fp-ts/lib/HKT' { | ||
declare module 'fp-ts/es6/HKT' { | ||
interface URItoKind2<E, A> { | ||
@@ -7,0 +7,0 @@ StateIO: StateIO<E, A>; |
@@ -1,4 +0,4 @@ | ||
import * as I from 'fp-ts/lib/IO'; | ||
import { getStateM } from 'fp-ts/lib/StateT'; | ||
import { pipeable } from 'fp-ts/lib/pipeable'; | ||
import * as I from 'fp-ts/es6/IO'; | ||
import { getStateM } from 'fp-ts/es6/StateT'; | ||
import { pipeable } from 'fp-ts/es6/pipeable'; | ||
const T = getStateM(I.io); | ||
@@ -5,0 +5,0 @@ /** |
@@ -1,11 +0,11 @@ | ||
import { Either } from 'fp-ts/lib/Either'; | ||
import { IO } from 'fp-ts/lib/IO'; | ||
import { IOEither } from 'fp-ts/lib/IOEither'; | ||
import { Monad3 } from 'fp-ts/lib/Monad'; | ||
import { MonadThrow3 } from 'fp-ts/lib/MonadThrow'; | ||
import { State } from 'fp-ts/lib/State'; | ||
import { Task } from 'fp-ts/lib/Task'; | ||
import * as TE from 'fp-ts/lib/TaskEither'; | ||
import { Either } from 'fp-ts/es6/Either'; | ||
import { IO } from 'fp-ts/es6/IO'; | ||
import { IOEither } from 'fp-ts/es6/IOEither'; | ||
import { Monad3 } from 'fp-ts/es6/Monad'; | ||
import { MonadThrow3 } from 'fp-ts/es6/MonadThrow'; | ||
import { State } from 'fp-ts/es6/State'; | ||
import { Task } from 'fp-ts/es6/Task'; | ||
import * as TE from 'fp-ts/es6/TaskEither'; | ||
import TaskEither = TE.TaskEither; | ||
declare module 'fp-ts/lib/HKT' { | ||
declare module 'fp-ts/es6/HKT' { | ||
interface URItoKind3<R, E, A> { | ||
@@ -12,0 +12,0 @@ StateTaskEither: StateTaskEither<R, E, A>; |
@@ -1,4 +0,4 @@ | ||
import { getStateM } from 'fp-ts/lib/StateT'; | ||
import * as TE from 'fp-ts/lib/TaskEither'; | ||
import { pipeable } from 'fp-ts/lib/pipeable'; | ||
import { getStateM } from 'fp-ts/es6/StateT'; | ||
import * as TE from 'fp-ts/es6/TaskEither'; | ||
import { pipeable } from 'fp-ts/es6/pipeable'; | ||
const T = getStateM(TE.taskEither); | ||
@@ -5,0 +5,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { Task } from 'fp-ts/lib/Task'; | ||
import { Task } from 'fp-ts/es6/Task'; | ||
/** | ||
@@ -3,0 +3,0 @@ * @since 0.1.8 |
@@ -1,2 +0,2 @@ | ||
import { Task } from 'fp-ts/lib/Task'; | ||
import { Task } from 'fp-ts/es6/Task'; | ||
/** | ||
@@ -6,4 +6,4 @@ * Returns the task result if it completes within a timeout, or a fallback value instead. | ||
* @example | ||
* import { withTimeout } from 'fp-ts-contrib/lib/Task/withTimeout' | ||
* import { delay, of } from 'fp-ts/lib/Task' | ||
* import { withTimeout } from 'fp-ts-contrib/es6/Task/withTimeout' | ||
* import { delay, of } from 'fp-ts/es6/Task' | ||
* | ||
@@ -10,0 +10,0 @@ * const completeAfter2s = delay(2000)(of('result')) |
@@ -1,2 +0,2 @@ | ||
import { getRaceMonoid, delay, of } from 'fp-ts/lib/Task'; | ||
import { getRaceMonoid, delay, of } from 'fp-ts/es6/Task'; | ||
/** | ||
@@ -6,4 +6,4 @@ * Returns the task result if it completes within a timeout, or a fallback value instead. | ||
* @example | ||
* import { withTimeout } from 'fp-ts-contrib/lib/Task/withTimeout' | ||
* import { delay, of } from 'fp-ts/lib/Task' | ||
* import { withTimeout } from 'fp-ts-contrib/es6/Task/withTimeout' | ||
* import { delay, of } from 'fp-ts/es6/Task' | ||
* | ||
@@ -10,0 +10,0 @@ * const completeAfter2s = delay(2000)(of('result')) |
@@ -1,9 +0,9 @@ | ||
import { Alt1 } from 'fp-ts/lib/Alt'; | ||
import { Task } from 'fp-ts/lib/Task'; | ||
import { Monad1 } from 'fp-ts/lib/Monad'; | ||
import { Option } from 'fp-ts/lib/Option'; | ||
import { TaskEither } from 'fp-ts/lib/TaskEither'; | ||
import { Lazy } from 'fp-ts/lib/function'; | ||
import { Filterable1 } from 'fp-ts/lib/Filterable'; | ||
declare module 'fp-ts/lib/HKT' { | ||
import { Alt1 } from 'fp-ts/es6/Alt'; | ||
import { Task } from 'fp-ts/es6/Task'; | ||
import { Monad1 } from 'fp-ts/es6/Monad'; | ||
import { Option } from 'fp-ts/es6/Option'; | ||
import { TaskEither } from 'fp-ts/es6/TaskEither'; | ||
import { Lazy } from 'fp-ts/es6/function'; | ||
import { Filterable1 } from 'fp-ts/es6/Filterable'; | ||
declare module 'fp-ts/es6/HKT' { | ||
interface URItoKind<A> { | ||
@@ -10,0 +10,0 @@ TaskOption: TaskOption<A>; |
@@ -1,6 +0,6 @@ | ||
import { task, of, map as taskMap } from 'fp-ts/lib/Task'; | ||
import { fromEither as optionFromEither, fromNullable as optionFromNullable, toUndefined as optionToUndefined, toNullable as optionToNullable, chain as optionChain, mapNullable as optionMapNullable, some as optionSome, none as optionNone, option } from 'fp-ts/lib/Option'; | ||
import { getOptionM } from 'fp-ts/lib/OptionT'; | ||
import { pipeable } from 'fp-ts/lib/pipeable'; | ||
import { getFilterableComposition } from 'fp-ts/lib/Filterable'; | ||
import { task, of, map as taskMap } from 'fp-ts/es6/Task'; | ||
import { fromEither as optionFromEither, fromNullable as optionFromNullable, toUndefined as optionToUndefined, toNullable as optionToNullable, chain as optionChain, mapNullable as optionMapNullable, some as optionSome, none as optionNone, option } from 'fp-ts/es6/Option'; | ||
import { getOptionM } from 'fp-ts/es6/OptionT'; | ||
import { pipeable } from 'fp-ts/es6/pipeable'; | ||
import { getFilterableComposition } from 'fp-ts/es6/Filterable'; | ||
const T = getOptionM(task); | ||
@@ -7,0 +7,0 @@ /** |
@@ -1,3 +0,3 @@ | ||
import { HKT, Kind, Kind2, Kind3, URIS, URIS2, URIS3 } from 'fp-ts/lib/HKT'; | ||
import { MonadIO, MonadIO1, MonadIO2, MonadIO2C, MonadIO3 } from 'fp-ts/lib/MonadIO'; | ||
import { HKT, Kind, Kind2, Kind3, URIS, URIS2, URIS3 } from 'fp-ts/es6/HKT'; | ||
import { MonadIO, MonadIO1, MonadIO2, MonadIO2C, MonadIO3 } from 'fp-ts/es6/MonadIO'; | ||
/** | ||
@@ -8,5 +8,5 @@ * Mimics the analogous Unix command: given an action `HKT<M, A>`, we can derive an action `HKT<M, [A, number]>` that | ||
* @example | ||
* import { io } from 'fp-ts/lib/IO' | ||
* import { randomInt } from 'fp-ts/lib/Random' | ||
* import { time } from 'fp-ts-contrib/lib/time' | ||
* import { io } from 'fp-ts/es6/IO' | ||
* import { randomInt } from 'fp-ts/es6/Random' | ||
* import { time } from 'fp-ts-contrib/es6/time' | ||
* | ||
@@ -13,0 +13,0 @@ * const timeIO = time(io) |
@@ -1,2 +0,2 @@ | ||
import { now } from 'fp-ts/lib/Date'; | ||
import { now } from 'fp-ts/es6/Date'; | ||
export function time(M) { | ||
@@ -3,0 +3,0 @@ const nowM = M.fromIO(now); |
@@ -13,12 +13,12 @@ /** | ||
*/ | ||
import { Applicative1 } from 'fp-ts/lib/Applicative'; | ||
import { Comonad1 } from 'fp-ts/lib/Comonad'; | ||
import { Monoid } from 'fp-ts/lib/Monoid'; | ||
import { NonEmptyArray } from 'fp-ts/lib/NonEmptyArray'; | ||
import { Option } from 'fp-ts/lib/Option'; | ||
import { Semigroup } from 'fp-ts/lib/Semigroup'; | ||
import { Show } from 'fp-ts/lib/Show'; | ||
import { Foldable1 } from 'fp-ts/lib/Foldable'; | ||
import { Traversable1 } from 'fp-ts/lib/Traversable'; | ||
declare module 'fp-ts/lib/HKT' { | ||
import { Applicative1 } from 'fp-ts/es6/Applicative'; | ||
import { Comonad1 } from 'fp-ts/es6/Comonad'; | ||
import { Monoid } from 'fp-ts/es6/Monoid'; | ||
import { NonEmptyArray } from 'fp-ts/es6/NonEmptyArray'; | ||
import { Option } from 'fp-ts/es6/Option'; | ||
import { Semigroup } from 'fp-ts/es6/Semigroup'; | ||
import { Show } from 'fp-ts/es6/Show'; | ||
import { Foldable1 } from 'fp-ts/es6/Foldable'; | ||
import { Traversable1 } from 'fp-ts/es6/Traversable'; | ||
declare module 'fp-ts/es6/HKT' { | ||
interface URItoKind<A> { | ||
@@ -25,0 +25,0 @@ Zipper: Zipper<A>; |
@@ -1,5 +0,5 @@ | ||
import * as A from 'fp-ts/lib/Array'; | ||
import { decrement, increment } from 'fp-ts/lib/function'; | ||
import { none, some } from 'fp-ts/lib/Option'; | ||
import { pipe, pipeable } from 'fp-ts/lib/pipeable'; | ||
import * as A from 'fp-ts/es6/Array'; | ||
import { decrement, increment } from 'fp-ts/es6/function'; | ||
import { none, some } from 'fp-ts/es6/Option'; | ||
import { pipe, pipeable } from 'fp-ts/es6/pipeable'; | ||
/** | ||
@@ -6,0 +6,0 @@ * @since 0.1.6 |
132
lib/Do.d.ts
@@ -8,22 +8,22 @@ import { HKT, Kind, Kind2, Kind3, URIS, URIS2, URIS3 } from 'fp-ts/lib/HKT'; | ||
export interface Do3<M extends URIS3, S extends object> { | ||
do: <U, L>(ma: Kind3<M, U, L, unknown>) => Do3C<M, S, U, L>; | ||
doL: <U, L>(f: (s: S) => Kind3<M, U, L, unknown>) => Do3C<M, S, U, L>; | ||
bind: <N extends string, A, U, L>(name: Exclude<N, keyof S>, ma: Kind3<M, U, L, A>) => Do3C<M, S & { | ||
do: <R, E>(ma: Kind3<M, R, E, any>) => Do3C<M, S, R, E>; | ||
doL: <R, E>(f: (s: S) => Kind3<M, R, E, any>) => Do3C<M, S, R, E>; | ||
bind: <N extends string, A, R, E>(name: Exclude<N, keyof S>, ma: Kind3<M, R, E, A>) => Do3C<M, S & { | ||
[K in N]: A; | ||
}, U, L>; | ||
bindL: <N extends string, A, U, L>(name: Exclude<N, keyof S>, f: (s: S) => Kind3<M, U, L, A>) => Do3C<M, S & { | ||
}, R, E>; | ||
bindL: <N extends string, A, R, E>(name: Exclude<N, keyof S>, f: (s: S) => Kind3<M, R, E, A>) => Do3C<M, S & { | ||
[K in N]: A; | ||
}, U, L>; | ||
sequenceS: <U, L, R extends Record<string, Kind3<M, U, L, any>>>(r: EnforceNonEmptyRecord<R> & Record<string, Kind3<M, U, L, any>> & { | ||
}, R, E>; | ||
sequenceS: <R, E, I extends Record<string, Kind3<M, R, E, any>>>(r: EnforceNonEmptyRecord<I> & Record<string, Kind3<M, R, E, any>> & { | ||
[K in keyof S]?: never; | ||
}) => Do3C<M, S & { | ||
[K in keyof R]: [R[K]] extends [Kind3<M, any, any, infer A>] ? A : never; | ||
}, U, L>; | ||
sequenceSL: <U, L, R extends Record<string, Kind3<M, U, L, any>>>(f: (s: S) => EnforceNonEmptyRecord<R> & Record<string, Kind3<M, U, L, any>> & { | ||
[K in keyof I]: [I[K]] extends [Kind3<M, any, any, infer A>] ? A : never; | ||
}, R, E>; | ||
sequenceSL: <R, E, I extends Record<string, Kind3<M, R, E, any>>>(f: (s: S) => EnforceNonEmptyRecord<I> & Record<string, Kind3<M, R, E, any>> & { | ||
[K in keyof S]?: never; | ||
}) => Do3C<M, S & { | ||
[K in keyof R]: [R[K]] extends [Kind3<M, any, any, infer A>] ? A : never; | ||
}, U, L>; | ||
return: <A, U, L>(f: (s: S) => A) => Kind3<M, U, L, A>; | ||
done: <U, L>() => Kind3<M, U, L, S>; | ||
[K in keyof I]: [I[K]] extends [Kind3<M, any, any, infer A>] ? A : never; | ||
}, R, E>; | ||
return: <R, E, A>(f: (s: S) => A) => Kind3<M, R, E, A>; | ||
done: <R, E>() => Kind3<M, R, E, S>; | ||
} | ||
@@ -33,23 +33,23 @@ /** | ||
*/ | ||
export interface Do3C<M extends URIS3, S extends object, U, L> { | ||
do: (ma: Kind3<M, U, L, unknown>) => Do3C<M, S, U, L>; | ||
doL: (f: (s: S) => Kind3<M, U, L, unknown>) => Do3C<M, S, U, L>; | ||
bind: <N extends string, A>(name: Exclude<N, keyof S>, ma: Kind3<M, U, L, A>) => Do3C<M, S & { | ||
export interface Do3C<M extends URIS3, S extends object, R, E> { | ||
do: (ma: Kind3<M, R, E, any>) => Do3C<M, S, R, E>; | ||
doL: (f: (s: S) => Kind3<M, R, E, any>) => Do3C<M, S, R, E>; | ||
bind: <N extends string, A>(name: Exclude<N, keyof S>, ma: Kind3<M, R, E, A>) => Do3C<M, S & { | ||
[K in N]: A; | ||
}, U, L>; | ||
bindL: <N extends string, A>(name: Exclude<N, keyof S>, f: (s: S) => Kind3<M, U, L, A>) => Do3C<M, S & { | ||
}, R, E>; | ||
bindL: <N extends string, A>(name: Exclude<N, keyof S>, f: (s: S) => Kind3<M, R, E, A>) => Do3C<M, S & { | ||
[K in N]: A; | ||
}, U, L>; | ||
sequenceS: <R extends Record<string, Kind3<M, U, L, any>>>(r: EnforceNonEmptyRecord<R> & { | ||
}, R, E>; | ||
sequenceS: <I extends Record<string, Kind3<M, R, E, any>>>(r: EnforceNonEmptyRecord<I> & { | ||
[K in keyof S]?: never; | ||
}) => Do3C<M, S & { | ||
[K in keyof R]: [R[K]] extends [Kind3<M, any, any, infer A>] ? A : never; | ||
}, U, L>; | ||
sequenceSL: <R extends Record<string, Kind3<M, U, L, any>>>(f: (s: S) => EnforceNonEmptyRecord<R> & { | ||
[K in keyof I]: [I[K]] extends [Kind3<M, any, any, infer A>] ? A : never; | ||
}, R, E>; | ||
sequenceSL: <I extends Record<string, Kind3<M, R, E, any>>>(f: (s: S) => EnforceNonEmptyRecord<I> & { | ||
[K in keyof S]?: never; | ||
}) => Do3C<M, S & { | ||
[K in keyof R]: [R[K]] extends [Kind3<M, any, any, infer A>] ? A : never; | ||
}, U, L>; | ||
return: <A>(f: (s: S) => A) => Kind3<M, U, L, A>; | ||
done: () => Kind3<M, U, L, S>; | ||
[K in keyof I]: [I[K]] extends [Kind3<M, any, any, infer A>] ? A : never; | ||
}, R, E>; | ||
return: <A>(f: (s: S) => A) => Kind3<M, R, E, A>; | ||
done: () => Kind3<M, R, E, S>; | ||
} | ||
@@ -60,22 +60,22 @@ /** | ||
export interface Do2<M extends URIS2, S extends object> { | ||
do: <L>(ma: Kind2<M, L, unknown>) => Do2C<M, S, L>; | ||
doL: <L>(f: (s: S) => Kind2<M, L, unknown>) => Do2C<M, S, L>; | ||
bind: <N extends string, A, L>(name: Exclude<N, keyof S>, ma: Kind2<M, L, A>) => Do2C<M, S & { | ||
do: <E>(ma: Kind2<M, E, any>) => Do2C<M, S, E>; | ||
doL: <E>(f: (s: S) => Kind2<M, E, any>) => Do2C<M, S, E>; | ||
bind: <N extends string, A, E>(name: Exclude<N, keyof S>, ma: Kind2<M, E, A>) => Do2C<M, S & { | ||
[K in N]: A; | ||
}, L>; | ||
bindL: <N extends string, A, L>(name: Exclude<N, keyof S>, f: (s: S) => Kind2<M, L, A>) => Do2C<M, S & { | ||
}, E>; | ||
bindL: <N extends string, A, E>(name: Exclude<N, keyof S>, f: (s: S) => Kind2<M, E, A>) => Do2C<M, S & { | ||
[K in N]: A; | ||
}, L>; | ||
sequenceS: <L, R extends Record<string, Kind2<M, L, any>>>(r: EnforceNonEmptyRecord<R> & Record<string, Kind2<M, L, any>> & { | ||
}, E>; | ||
sequenceS: <E, I extends Record<string, Kind2<M, E, any>>>(r: EnforceNonEmptyRecord<I> & Record<string, Kind2<M, E, any>> & { | ||
[K in keyof S]?: never; | ||
}) => Do2C<M, S & { | ||
[K in keyof R]: [R[K]] extends [Kind2<M, any, infer A>] ? A : never; | ||
}, L>; | ||
sequenceSL: <L, R extends Record<string, Kind2<M, L, any>>>(f: (s: S) => EnforceNonEmptyRecord<R> & Record<string, Kind2<M, L, any>> & { | ||
[K in keyof I]: [I[K]] extends [Kind2<M, any, infer A>] ? A : never; | ||
}, E>; | ||
sequenceSL: <E, I extends Record<string, Kind2<M, E, any>>>(f: (s: S) => EnforceNonEmptyRecord<I> & Record<string, Kind2<M, E, any>> & { | ||
[K in keyof S]?: never; | ||
}) => Do2C<M, S & { | ||
[K in keyof R]: [R[K]] extends [Kind2<M, any, infer A>] ? A : never; | ||
}, L>; | ||
return: <A, L>(f: (s: S) => A) => Kind2<M, L, A>; | ||
done: <L>() => Kind2<M, L, S>; | ||
[K in keyof I]: [I[K]] extends [Kind2<M, any, infer A>] ? A : never; | ||
}, E>; | ||
return: <E, A>(f: (s: S) => A) => Kind2<M, E, A>; | ||
done: <E>() => Kind2<M, E, S>; | ||
} | ||
@@ -85,23 +85,23 @@ /** | ||
*/ | ||
export interface Do2C<M extends URIS2, S extends object, L> { | ||
do: (ma: Kind2<M, L, unknown>) => Do2C<M, S, L>; | ||
doL: (f: (s: S) => Kind2<M, L, unknown>) => Do2C<M, S, L>; | ||
bind: <N extends string, A>(name: Exclude<N, keyof S>, ma: Kind2<M, L, A>) => Do2C<M, S & { | ||
export interface Do2C<M extends URIS2, S extends object, E> { | ||
do: (ma: Kind2<M, E, any>) => Do2C<M, S, E>; | ||
doL: (f: (s: S) => Kind2<M, E, any>) => Do2C<M, S, E>; | ||
bind: <N extends string, A>(name: Exclude<N, keyof S>, ma: Kind2<M, E, A>) => Do2C<M, S & { | ||
[K in N]: A; | ||
}, L>; | ||
bindL: <N extends string, A>(name: Exclude<N, keyof S>, f: (s: S) => Kind2<M, L, A>) => Do2C<M, S & { | ||
}, E>; | ||
bindL: <N extends string, A>(name: Exclude<N, keyof S>, f: (s: S) => Kind2<M, E, A>) => Do2C<M, S & { | ||
[K in N]: A; | ||
}, L>; | ||
sequenceS: <R extends Record<string, Kind2<M, L, any>>>(r: EnforceNonEmptyRecord<R> & { | ||
}, E>; | ||
sequenceS: <I extends Record<string, Kind2<M, E, any>>>(r: EnforceNonEmptyRecord<I> & { | ||
[K in keyof S]?: never; | ||
}) => Do2C<M, S & { | ||
[K in keyof R]: [R[K]] extends [Kind2<M, any, infer A>] ? A : never; | ||
}, L>; | ||
sequenceSL: <R extends Record<string, Kind2<M, L, any>>>(f: (s: S) => EnforceNonEmptyRecord<R> & { | ||
[K in keyof I]: [I[K]] extends [Kind2<M, any, infer A>] ? A : never; | ||
}, E>; | ||
sequenceSL: <I extends Record<string, Kind2<M, E, any>>>(f: (s: S) => EnforceNonEmptyRecord<I> & { | ||
[K in keyof S]?: never; | ||
}) => Do2C<M, S & { | ||
[K in keyof R]: [R[K]] extends [Kind2<M, any, infer A>] ? A : never; | ||
}, L>; | ||
return: <A>(f: (s: S) => A) => Kind2<M, L, A>; | ||
done: () => Kind2<M, L, S>; | ||
[K in keyof I]: [I[K]] extends [Kind2<M, any, infer A>] ? A : never; | ||
}, E>; | ||
return: <A>(f: (s: S) => A) => Kind2<M, E, A>; | ||
done: () => Kind2<M, E, S>; | ||
} | ||
@@ -112,4 +112,4 @@ /** | ||
export interface Do1<M extends URIS, S extends object> { | ||
do: (ma: Kind<M, unknown>) => Do1<M, S>; | ||
doL: (f: (s: S) => Kind<M, unknown>) => Do1<M, S>; | ||
do: (ma: Kind<M, any>) => Do1<M, S>; | ||
doL: (f: (s: S) => Kind<M, any>) => Do1<M, S>; | ||
bind: <N extends string, A>(name: Exclude<N, keyof S>, ma: Kind<M, A>) => Do1<M, S & { | ||
@@ -126,6 +126,6 @@ [K in N]: A; | ||
}>; | ||
sequenceSL: <R extends Record<string, Kind<M, any>>>(f: (s: S) => EnforceNonEmptyRecord<R> & { | ||
sequenceSL: <I extends Record<string, Kind<M, any>>>(f: (s: S) => EnforceNonEmptyRecord<I> & { | ||
[K in keyof S]?: never; | ||
}) => Do1<M, S & { | ||
[K in keyof R]: [R[K]] extends [Kind<M, infer A>] ? A : never; | ||
[K in keyof I]: [I[K]] extends [Kind<M, infer A>] ? A : never; | ||
}>; | ||
@@ -139,4 +139,4 @@ return: <A>(f: (s: S) => A) => Kind<M, A>; | ||
export interface Do0<M, S extends object> { | ||
do: (ma: HKT<M, unknown>) => Do0<M, S>; | ||
doL: (f: (s: S) => HKT<M, unknown>) => Do0<M, S>; | ||
do: (ma: HKT<M, any>) => Do0<M, S>; | ||
doL: (f: (s: S) => HKT<M, any>) => Do0<M, S>; | ||
bind: <N extends string, A>(name: Exclude<N, keyof S>, ma: HKT<M, A>) => Do0<M, S & { | ||
@@ -148,3 +148,3 @@ [K in N]: A; | ||
}>; | ||
sequenceS: <R extends Record<string, HKT<M, unknown>>>(r: EnforceNonEmptyRecord<R> & { | ||
sequenceS: <R extends Record<string, HKT<M, any>>>(r: EnforceNonEmptyRecord<R> & { | ||
[K in keyof S]?: never; | ||
@@ -154,3 +154,3 @@ }) => Do0<M, S & { | ||
}>; | ||
sequenceSL: <R extends Record<string, HKT<M, unknown>>>(f: (s: S) => EnforceNonEmptyRecord<R> & { | ||
sequenceSL: <R extends Record<string, HKT<M, any>>>(f: (s: S) => EnforceNonEmptyRecord<R> & { | ||
[K in keyof S]?: never; | ||
@@ -157,0 +157,0 @@ }) => Do0<M, S & { |
{ | ||
"name": "fp-ts-contrib", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"description": "A community driven utility package for fp-ts", | ||
@@ -21,7 +21,8 @@ "files": [ | ||
"clean": "rimraf rm -rf lib/* es6/*", | ||
"build": "npm run clean && tsc && tsc -p tsconfig.es6.json", | ||
"build": "npm run clean && tsc && tsc -p tsconfig.es6.json && npm run import-path-rewrite", | ||
"prepublish": "npm run build", | ||
"dtslint": "dtslint dtslint", | ||
"mocha": "mocha -r ts-node/register test/*.ts", | ||
"docs": "docs-ts" | ||
"docs": "docs-ts", | ||
"import-path-rewrite": "import-path-rewrite" | ||
}, | ||
@@ -51,2 +52,3 @@ "repository": { | ||
"fp-ts": "^2.1.2", | ||
"import-path-rewrite": "github:gcanti/import-path-rewrite", | ||
"jest": "^24.8.0", | ||
@@ -53,0 +55,0 @@ "mocha": "^5.2.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
216871
19