diff --git a/.changeset/loud-otters-share.md b/.changeset/loud-otters-share.md new file mode 100644 index 00000000..2986f4c1 --- /dev/null +++ b/.changeset/loud-otters-share.md @@ -0,0 +1,6 @@ +--- +"@tsplus/runtime": patch +"@tsplus/stdlib": patch +--- + +Removed Not Needed Lazy and Update TS+ diff --git a/package.json b/package.json index d41613f6..8a5e7473 100644 --- a/package.json +++ b/package.json @@ -39,11 +39,11 @@ "@effect-ts/build-utils": "0.40.3", "@effect-ts/core": "^0.60.2", "@repo-tooling/eslint-plugin-dprint": "^0.0.4", - "@tsplus/installer": "0.0.132", - "@types/node": "^18.6.4", + "@tsplus/installer": "0.0.133", + "@types/node": "^18.6.5", "@types/rimraf": "^3.0.2", - "@typescript-eslint/eslint-plugin": "^5.32.0", - "@typescript-eslint/parser": "^5.32.0", + "@typescript-eslint/eslint-plugin": "^5.33.0", + "@typescript-eslint/parser": "^5.33.0", "babel-plugin-annotate-pure-calls": "^0.4.0", "babel-plugin-replace-import-extension": "^1.1.3", "c8": "^7.12.0", @@ -60,8 +60,8 @@ "rimraf": "^3.0.2", "typescript": "^4.7.4", "ultra-runner": "^3.10.5", - "vite": "^3.0.4", - "vitest": "0.20.3" + "vite": "^3.0.5", + "vitest": "0.21.1" }, "resolutions": { "eslint-plugin-codegen": "patch:eslint-plugin-codegen@npm:0.16.1#.yarn/patches/eslint-plugin-codegen-npm-0.16.1-87770191cd" diff --git a/packages/runtime/_src/Brand.ts b/packages/runtime/_src/Brand.ts index bf08e83d..fd5cab24 100644 --- a/packages/runtime/_src/Brand.ts +++ b/packages/runtime/_src/Brand.ts @@ -34,7 +34,8 @@ export declare namespace Brand { export type Brands

= P extends Valid ? TypeLevel.UnionToIntersection< { - [k in keyof P[Brand.valid]]: P extends P[Brand.valid][k] ? k extends string ? Valid : never + [k in keyof P[Brand.valid]]: P extends P[Brand.valid][k] + ? k extends string ? Valid : never : never }[keyof P[Brand.valid]] > @@ -79,18 +80,23 @@ export declare namespace Brand { readonly validate: (a: A) => a is A & Brand.Valid } - export type ValidatedWith> = X extends Validation ? Validated + export type ValidatedWith> = X extends Validation + ? Validated : never /** * @tsplus type Brand/Ops */ export interface Ops { - readonly validation: (predicate: (a: A) => boolean) => Brand.Validation + readonly validation: ( + predicate: (a: A) => boolean + ) => Brand.Validation } } -export function validation(predicate: (a: A) => boolean): Brand.Validation { +export function validation( + predicate: (a: A) => boolean +): Brand.Validation { return { validate: (value): value is Brand.Validated => predicate(value) } diff --git a/packages/runtime/_src/Decoder.ts b/packages/runtime/_src/Decoder.ts index 879480fa..7a421151 100644 --- a/packages/runtime/_src/Decoder.ts +++ b/packages/runtime/_src/Decoder.ts @@ -24,7 +24,9 @@ export const Decoder: DecoderOps = {} /** * @tsplus static Decoder/Ops __call */ -export function make(decodeResult: (u: unknown) => Result): Decoder { +export function make( + decodeResult: (u: unknown) => Result +): Decoder { return { decodeResult } @@ -82,7 +84,10 @@ export class DecoderErrorPrimitive implements Decoder.Error { readonly expectedType: string ) {} render = () => { - return Tree(`Expected a value of type "${this.expectedType}" but received one of type "${typeof this.value}"`) + return Tree( + `Expected a value of type "${this.expectedType}" but received one of type "${typeof this + .value}"` + ) } } @@ -100,7 +105,10 @@ export class DecoderErrorIsoDateMalformed implements Decoder.Error { readonly value: unknown ) {} render = () => { - return Tree(`Expected a Date represented as an iso string instead received one of type "${typeof this.value}"`) + return Tree( + `Expected a Date represented as an iso string instead received one of type "${typeof this + .value}"` + ) } } @@ -116,7 +124,9 @@ export class DecoderErrorLiteral implements Decoder.Error { ` of type "${typeof this.expected}"` : "" } instead received ${ - typeof this.value === typeof this.expected ? `"${this.value}"` : `one of type "${typeof this.value}"` + typeof this.value === typeof this.expected ? + `"${this.value}"` : + `one of type "${typeof this.value}"` }` ) } @@ -138,18 +148,24 @@ export class DecoderErrorStruct implements Decoder.Error { constructor( readonly fields: Chunk ) {} - render = () => Tree(`Encountered while parsing an object structure`, this.fields.map((d) => d.render())) + render = () => + Tree(`Encountered while parsing an object structure`, this.fields.map((d) => d.render())) } export class DecoderErrorTaggedMalformed implements Decoder.Error { constructor(readonly keys: string[]) {} render = () => - Tree(`Expected a tagged object of the form "{ _tag: ${this.keys.sort().map(k => `"${k}"`).join(" | ")} }"`) + Tree( + `Expected a tagged object of the form "{ _tag: ${ + this.keys.sort().map(k => `"${k}"`).join(" | ") + } }"` + ) } export class DecoderErrorTaggedInner implements Decoder.Error { constructor(readonly tag: string, readonly error: Decoder.Error) {} - render = () => Tree(`Encountered while processing tagged object "${this.tag}"`, Chunk(this.error.render())) + render = () => + Tree(`Encountered while processing tagged object "${this.tag}"`, Chunk(this.error.render())) } export class DecoderErrorUnionMember implements Decoder.Error { @@ -171,7 +187,9 @@ export class DecoderErrorArray implements Decoder.Error { render = () => Tree( `Encountered while processing an Array of elements`, - this.errors.map(([n, err]) => Tree(`Encountered while processing element "${n}"`, Chunk(err.render()))) + this.errors.map(([n, err]) => + Tree(`Encountered while processing element "${n}"`, Chunk(err.render())) + ) ) } @@ -191,35 +209,45 @@ export class DecoderErrorValidation implements Decoder.Error { * @tsplus implicit */ export const _true: Decoder = Decoder((u) => - Derive>().is(u) ? Result.success(u) : Result.fail(new DecoderErrorPrimitive(u, "true")) + Derive>().is(u) ? + Result.success(u) : + Result.fail(new DecoderErrorPrimitive(u, "true")) ) /** * @tsplus implicit */ export const _false: Decoder = Decoder((u) => - Derive>().is(u) ? Result.success(u) : Result.fail(new DecoderErrorPrimitive(u, "false")) + Derive>().is(u) ? + Result.success(u) : + Result.fail(new DecoderErrorPrimitive(u, "false")) ) /** * @tsplus implicit */ export const boolean: Decoder = Decoder((u) => - Derive>().is(u) ? Result.success(u) : Result.fail(new DecoderErrorPrimitive(u, "boolean")) + Derive>().is(u) ? + Result.success(u) : + Result.fail(new DecoderErrorPrimitive(u, "boolean")) ) /** * @tsplus implicit */ export const string: Decoder = Decoder((u) => - Derive>().is(u) ? Result.success(u) : Result.fail(new DecoderErrorPrimitive(u, "string")) + Derive>().is(u) ? + Result.success(u) : + Result.fail(new DecoderErrorPrimitive(u, "string")) ) /** * @tsplus implicit */ export const number: Decoder = Decoder((u) => - Derive>().is(u) ? Result.success(u) : Result.fail(new DecoderErrorPrimitive(u, "number")) + Derive>().is(u) ? + Result.success(u) : + Result.fail(new DecoderErrorPrimitive(u, "number")) ) /** @@ -374,7 +402,10 @@ export function deriveArray>( if (hasFailed) { return Result.fail(new DecoderErrorArray(errors)) } - return Result.success(out as A, errors.isEmpty ? Maybe.none : Maybe.some(new DecoderErrorArray(errors))) + return Result.success( + out as A, + errors.isEmpty ? Maybe.none : Maybe.some(new DecoderErrorArray(errors)) + ) } return Result.fail(new DecoderErrorPrimitive(u, "Array")) }) @@ -382,7 +413,10 @@ export function deriveArray>( type EitherStructural = { _tag: "Left"; left: E } | { _tag: "Right"; right: A } -function deriveEitherInternal(left: Decoder, right: Decoder): Decoder> { +function deriveEitherInternal( + left: Decoder, + right: Decoder +): Decoder> { return Derive() } @@ -390,11 +424,15 @@ function deriveEitherInternal(left: Decoder, right: Decoder): Decode * @tsplus derive Decoder[Either]<_> 10 */ export function deriveEither>( - ...[left, right]: [A] extends [Either] ? [left: Decoder<_E>, right: Decoder<_A>] : never + ...[left, right]: [A] extends [Either] + ? [left: Decoder<_E>, right: Decoder<_A>] + : never ): Decoder { const structural = deriveEitherInternal(left, right) return Decoder((u) => - structural.decodeResult(u).map((e) => e._tag === "Left" ? Either.left(e.left) as A : Either.right(e.right) as A) + structural.decodeResult(u).map((e) => + e._tag === "Left" ? Either.left(e.left) as A : Either.right(e.right) as A + ) ) } @@ -415,7 +453,9 @@ export function deriveMaybe>( ): Decoder { const structural = deriveMaybeInternal(value) return Decoder((u) => - structural.decodeResult(u).map((e) => e._tag === "Some" ? Maybe.some(e.value) as A : Maybe.none as A) + structural.decodeResult(u).map((e) => + e._tag === "Some" ? Maybe.some(e.value) as A : Maybe.none as A + ) ) } @@ -424,14 +464,16 @@ export class DecoderErrorRecordValue implements Decoder.Error { readonly key: string, readonly error: Decoder.Error ) {} - render = () => Tree(`Encountered while parsing a record value at "${this.key}"`, Chunk(this.error.render())) + render = () => + Tree(`Encountered while parsing a record value at "${this.key}"`, Chunk(this.error.render())) } export class DecoderErrorRecordFields implements Decoder.Error { constructor( readonly fields: Chunk ) {} - render = () => Tree(`Encountered while parsing a record structure`, this.fields.map((d) => d.render())) + render = () => + Tree(`Encountered while parsing a record structure`, this.fields.map((d) => d.render())) } export class DecoderErrorRecordMissingKeys implements Decoder.Error { @@ -440,7 +482,9 @@ export class DecoderErrorRecordMissingKeys implements Decoder.Error { ) {} render = () => Tree( - `Encountered while parsing a record structure, missing keys: ${this.missing.map((k) => `"${k}"`).join(", ")}` + `Encountered while parsing a record structure, missing keys: ${ + this.missing.map((k) => `"${k}"`).join(", ") + }` ) } @@ -452,7 +496,9 @@ export function deriveEmptyRecord( ): Decoder { const record = Derive>() // @ts-expect-error - return Decoder((u) => record.is(u) ? Result.success(u) : Result.fail(new DecoderErrorPrimitive(u, "{}"))) + return Decoder((u) => + record.is(u) ? Result.success(u) : Result.fail(new DecoderErrorPrimitive(u, "{}")) + ) } /** @@ -553,9 +599,13 @@ export function deriveRecord>( * @tsplus derive Decoder<_> 20 */ export function deriveLiteral( - ...[value]: Check & Check.Not>> extends Check.True ? [value: A] : never + ...[value]: Check & Check.Not>> extends Check.True + ? [value: A] + : never ): Decoder { - return Decoder((u) => u === value ? Result.success(u as A) : Result.fail(new DecoderErrorLiteral(value, u))) + return Decoder((u) => + u === value ? Result.success(u as A) : Result.fail(new DecoderErrorLiteral(value, u)) + ) } /** diff --git a/packages/runtime/_src/Encoder.ts b/packages/runtime/_src/Encoder.ts index f931b4bb..f0cc5534 100644 --- a/packages/runtime/_src/Encoder.ts +++ b/packages/runtime/_src/Encoder.ts @@ -91,7 +91,8 @@ export function deriveNamed>( * @tsplus derive Encoder<_> 10 */ export function deriveValidation>( - ...[base]: Check> extends Check.True ? [base: Encoder>] : never + ...[base]: Check> extends Check.True ? [base: Encoder>] + : never ): Encoder { return Encoder((a) => base.encode(a as Brand.Unbranded)) } @@ -112,7 +113,10 @@ export function deriveLazy(fn: (_: Encoder) => Encoder): Encoder { type EitherStructural = { _tag: "Left"; left: E } | { _tag: "Right"; right: A } -function deriveEitherInternal(left: Encoder, right: Encoder): Encoder> { +function deriveEitherInternal( + left: Encoder, + right: Encoder +): Encoder> { return Derive() } @@ -120,7 +124,9 @@ function deriveEitherInternal(left: Encoder, right: Encoder): Encode * @tsplus derive Encoder[Either]<_> 10 */ export function deriveEither>( - ...[left, right]: [A] extends [Either] ? [left: Encoder<_E>, right: Encoder<_A>] : never + ...[left, right]: [A] extends [Either] + ? [left: Encoder<_E>, right: Encoder<_A>] + : never ): Encoder { const structural = deriveEitherInternal(left, right) return Encoder((u) => structural.encode(u)) @@ -250,7 +256,9 @@ export function deriveRecord>( * @tsplus derive Encoder<_> 20 */ export function deriveLiteral( - ...[value]: Check & Check.Not>> extends Check.True ? [value: A] : never + ...[value]: Check & Check.Not>> extends Check.True + ? [value: A] + : never ): Encoder { return Encoder(() => value) } diff --git a/packages/runtime/_src/Guard.ts b/packages/runtime/_src/Guard.ts index 8c1cbca4..b5865042 100644 --- a/packages/runtime/_src/Guard.ts +++ b/packages/runtime/_src/Guard.ts @@ -125,14 +125,18 @@ export function deriveValidation>( : never ): Guard { const validateBrands = Object.keys(brands).map((k) => brands[k]!) - return Guard((u): u is A => base.is(u) && validateBrands.every((brand) => brand.validate(u as any))) + return Guard((u): u is A => + base.is(u) && validateBrands.every((brand) => brand.validate(u as any)) + ) } /** * @tsplus derive Guard<_> 20 */ export function deriveLiteral( - ...[value]: Check & Check.Not>> extends Check.True ? [value: A] : never + ...[value]: Check & Check.Not>> extends Check.True + ? [value: A] + : never ): Guard { return Guard((u): u is A => u === value) } @@ -305,7 +309,10 @@ export function deriveStruct>( } if (optionalFields) { for (const field of Object.keys(optionalFields)) { - if (field in u && typeof u[field] !== "undefined" && !(optionalFields[field] as Guard).is(u[field])) { + if ( + field in u && typeof u[field] !== "undefined" && + !(optionalFields[field] as Guard).is(u[field]) + ) { return false } } @@ -320,7 +327,8 @@ export function deriveStruct>( * @tsplus derive Guard<_> 15 */ export function deriveDictionary>( - ...[valueGuard]: Check> extends Check.True ? [value: Guard] : never + ...[valueGuard]: Check> extends Check.True ? [value: Guard] + : never ): Guard { return Guard((u): u is A => { if (Derive>().is(u)) { diff --git a/packages/runtime/_src/Result.ts b/packages/runtime/_src/Result.ts index 766701cf..ad681a50 100644 --- a/packages/runtime/_src/Result.ts +++ b/packages/runtime/_src/Result.ts @@ -9,10 +9,18 @@ export type Result = Success | SuccessWithWarning | Failure export interface ResultOps {} export const Result: ResultOps = {} +export const _T = Symbol.for("@tsplus/runtime/Result/_T") +export type _T = typeof _T + /** * @tsplus type Result/Success */ export interface Success { + readonly [_T]?: { + _W: (_: never) => never + _E: (_: never) => never + _A: (_: never) => A + } readonly _tag: "Success" readonly success: A } @@ -21,6 +29,11 @@ export interface Success { * @tsplus type Result/SuccessWithWarning */ export interface SuccessWithWarning { + readonly [_T]?: { + _W: (_: never) => W + _E: (_: never) => never + _A: (_: never) => A + } readonly _tag: "SuccessWithWarning" readonly success: A readonly warning: W @@ -30,12 +43,16 @@ export interface SuccessWithWarning { * @tsplus type Result/Failure */ export interface Failure { + readonly [_T]?: { + _W: (_: never) => never + _E: (_: never) => E + _A: (_: never) => never + } readonly _tag: "Failure" readonly failure: E } /** - * @tsplus unify Result * @tsplus unify Result/Success * @tsplus unify Result/SuccessWithWarning * @tsplus unify Result/Failure @@ -43,9 +60,30 @@ export interface Failure { export function unifyResult>( self: X ): Result< - [X] extends [Result] ? W : never, - [X] extends [Result] ? E : never, - [X] extends [Result] ? A : never + [X] extends [{ + readonly [_T]?: { + _W: (_: never) => infer W + _E: (_: never) => infer E + _A: (_: never) => infer A + } + }] ? W + : never, + [X] extends [{ + readonly [_T]?: { + _W: (_: never) => infer W + _E: (_: never) => infer E + _A: (_: never) => infer A + } + }] ? E + : never, + [X] extends [{ + readonly [_T]?: { + _W: (_: never) => infer W + _E: (_: never) => infer E + _A: (_: never) => infer A + } + }] ? A + : never > { return self } @@ -128,7 +166,9 @@ export function isFailure(self: Result): self is Failure { /** * @tsplus fluent Result isSuccessWihWarning */ -export function isSuccessWihWarning(self: Result): self is SuccessWithWarning { +export function isSuccessWihWarning( + self: Result +): self is SuccessWithWarning { return self._tag === "SuccessWithWarning" } diff --git a/packages/runtime/_test/Decoder.test.ts b/packages/runtime/_test/Decoder.test.ts index a8bf939e..9bfe6baa 100644 --- a/packages/runtime/_test/Decoder.test.ts +++ b/packages/runtime/_test/Decoder.test.ts @@ -108,7 +108,8 @@ describe.concurrent("Decoder", () => { { firstName: "Michael", lastName: "Arnaldi", age: 30 } ) assert.isTrue( - decoder.decode({ firstName: "Michael", lastName: "Arnaldi", age: "30" }).left.value?.message === + decoder.decode({ firstName: "Michael", lastName: "Arnaldi", age: "30" }).left.value + ?.message === ( "Encountered while parsing an object structure\n" + "└─ Field \"age\"\n" + @@ -141,7 +142,10 @@ describe.concurrent("Decoder", () => { const decoder: Decoder = Derive() assert.deepEqual(decoder.decode({ _tag: "A" }).right.value, { _tag: "A" }) assert.deepEqual(decoder.decode({ _tag: "B" }).right.value, { _tag: "B" }) - assert.deepEqual(decoder.decode({ _tag: "C", field: "F" }).right.value, { _tag: "C", field: "F" }) + assert.deepEqual(decoder.decode({ _tag: "C", field: "F" }).right.value, { + _tag: "C", + field: "F" + }) assert.isTrue( decoder.decode({ _tag: "D" }).left.value?.message === "Expected a tagged object of the form \"{ _tag: \"A\" | \"B\" | \"C\" }\"" @@ -211,13 +215,16 @@ describe.concurrent("Decoder", () => { decoder.decode(["a", "b", "c"]) == Either.right(ImmutableArray("a", "b", "c")) ) assert.isTrue( - decoder.decode(0).left.value?.message === "Expected a value of type \"Array\" but received one of type \"number\"" + decoder.decode(0).left.value?.message === + "Expected a value of type \"Array\" but received one of type \"number\"" ) }) it("either", () => { const decoder: Decoder> = Derive() assert.isTrue(decoder.decode({ _tag: "Left", left: 0 }) == Either.right(Either.left(0))) - assert.isTrue(decoder.decode({ _tag: "Right", right: "ok" }) == Either.right(Either.right("ok"))) + assert.isTrue( + decoder.decode({ _tag: "Right", right: "ok" }) == Either.right(Either.right("ok")) + ) assert.isTrue( decoder.decode({ _tag: "Left", left: "ok" }).left.value?.message == ( @@ -244,7 +251,8 @@ describe.concurrent("Decoder", () => { assert.isTrue( decoder.decode({ _tag: "Left" - }).left.value?.message === "Expected a tagged object of the form \"{ _tag: \"None\" | \"Some\" }\"" + }).left.value?.message === + "Expected a tagged object of the form \"{ _tag: \"None\" | \"Some\" }\"" ) }) it("validated", () => { @@ -266,15 +274,20 @@ describe.concurrent("Decoder", () => { assert.isTrue(decoderPositive.decode(1) == Either.right(1)) assert.isTrue( - decoderPositive.decode(-1).left.value?.message === "Encountered while processing validations: Positive" + decoderPositive.decode(-1).left.value?.message === + "Encountered while processing validations: Positive" ) const positiveInt: Decoder = Derive() assert.isTrue( - positiveInt.decode(-1.5).left.value?.message === "Encountered while processing validations: Int, Positive" + positiveInt.decode(-1.5).left.value?.message === + "Encountered while processing validations: Int, Positive" + ) + assert.isTrue( + positiveInt.decode(-1).left.value?.message === + "Encountered while processing validations: Positive" ) - assert.isTrue(positiveInt.decode(-1).left.value?.message === "Encountered while processing validations: Positive") }) it("record", () => { const decoder: Decoder> = Derive() diff --git a/packages/stdlib/_src/collections/Chunk/definition.ts b/packages/stdlib/_src/collections/Chunk/definition.ts index 92bc2f5f..3f5640de 100644 --- a/packages/stdlib/_src/collections/Chunk/definition.ts +++ b/packages/stdlib/_src/collections/Chunk/definition.ts @@ -233,7 +233,9 @@ export abstract class ChunkInternal implements Chunk, Equals { return this.start._concat(chunk)._concat(that) } if (that._typeId === PrependNTypeId) { - const chunk = array_(that.bufferUsed === 0 ? [] : (that.buffer as A1[]).slice(-that.bufferUsed)) + const chunk = array_( + that.bufferUsed === 0 ? [] : (that.buffer as A1[]).slice(-that.bufferUsed) + ) return this._concat(chunk)._concat(that.end) } const diff = that.depth - this.depth diff --git a/packages/stdlib/_src/collections/Chunk/operations/collectWhile.ts b/packages/stdlib/_src/collections/Chunk/operations/collectWhile.ts index 1388ce56..32d59758 100644 --- a/packages/stdlib/_src/collections/Chunk/operations/collectWhile.ts +++ b/packages/stdlib/_src/collections/Chunk/operations/collectWhile.ts @@ -1,4 +1,8 @@ -import { ArrTypeId, concreteChunk, SingletonTypeId } from "@tsplus/stdlib/collections/Chunk/definition" +import { + ArrTypeId, + concreteChunk, + SingletonTypeId +} from "@tsplus/stdlib/collections/Chunk/definition" /** * Transforms all elements of the chunk for as long as the specified partial diff --git a/packages/stdlib/_src/collections/Chunk/operations/compactWithIndexF.ts b/packages/stdlib/_src/collections/Chunk/operations/compactWithIndexF.ts index 6abb0eac..8bf20de4 100644 --- a/packages/stdlib/_src/collections/Chunk/operations/compactWithIndexF.ts +++ b/packages/stdlib/_src/collections/Chunk/operations/compactWithIndexF.ts @@ -1,7 +1,10 @@ /** * @tsplus static Chunk.Ops compactWithIndexF */ -export const compactWithIndexF = WitherableWithIndex.implementCompactWithIndexF()( +export const compactWithIndexF = WitherableWithIndex.implementCompactWithIndexF< + number, + Chunk.HKT +>()( (_: { A: A B: B diff --git a/packages/stdlib/_src/collections/Chunk/operations/extend.ts b/packages/stdlib/_src/collections/Chunk/operations/extend.ts index c7ae8b11..2f2f8e6d 100644 --- a/packages/stdlib/_src/collections/Chunk/operations/extend.ts +++ b/packages/stdlib/_src/collections/Chunk/operations/extend.ts @@ -3,5 +3,6 @@ * @tsplus pipeable Chunk extend */ export function extend(f: (chunk: Chunk) => B) { - return (self: Chunk): Chunk => Chunk.from(self.mapWithIndex((i, _) => f(Chunk.from(self.skip(i))))) + return (self: Chunk): Chunk => + Chunk.from(self.mapWithIndex((i, _) => f(Chunk.from(self.skip(i))))) } diff --git a/packages/stdlib/_src/collections/Chunk/operations/forEachF.ts b/packages/stdlib/_src/collections/Chunk/operations/forEachF.ts index 757cac99..4ae2661f 100644 --- a/packages/stdlib/_src/collections/Chunk/operations/forEachF.ts +++ b/packages/stdlib/_src/collections/Chunk/operations/forEachF.ts @@ -1,4 +1,5 @@ /** * @tsplus static Chunk.Ops forEachF */ -export const forEachF: ForEach.Fn = (G) => (f) => Chunk.forEachWithIndexF(G)((_, a) => f(a)) +export const forEachF: ForEach.Fn = (G) => + (f) => Chunk.forEachWithIndexF(G)((_, a) => f(a)) diff --git a/packages/stdlib/_src/collections/Chunk/operations/join.ts b/packages/stdlib/_src/collections/Chunk/operations/join.ts index 575daac1..14f87f52 100644 --- a/packages/stdlib/_src/collections/Chunk/operations/join.ts +++ b/packages/stdlib/_src/collections/Chunk/operations/join.ts @@ -5,5 +5,6 @@ * @tsplus pipeable Chunk join */ export function join(sep: string) { - return (self: Chunk): string => self.reduce("", (s, a) => (s.length > 0 ? `${s}${sep}${a}` : a)) + return (self: Chunk): string => + self.reduce("", (s, a) => (s.length > 0 ? `${s}${sep}${a}` : a)) } diff --git a/packages/stdlib/_src/collections/Chunk/operations/map.ts b/packages/stdlib/_src/collections/Chunk/operations/map.ts index 84c97359..e0b45304 100644 --- a/packages/stdlib/_src/collections/Chunk/operations/map.ts +++ b/packages/stdlib/_src/collections/Chunk/operations/map.ts @@ -1,4 +1,9 @@ -import { Chunk, concreteChunk, Singleton, SingletonTypeId } from "@tsplus/stdlib/collections/Chunk/definition" +import { + Chunk, + concreteChunk, + Singleton, + SingletonTypeId +} from "@tsplus/stdlib/collections/Chunk/definition" /** * Returns a chunk with the elements mapped by the specified function. diff --git a/packages/stdlib/_src/collections/Chunk/operations/mapWithIndex.ts b/packages/stdlib/_src/collections/Chunk/operations/mapWithIndex.ts index 3e7a2d9a..21feb990 100644 --- a/packages/stdlib/_src/collections/Chunk/operations/mapWithIndex.ts +++ b/packages/stdlib/_src/collections/Chunk/operations/mapWithIndex.ts @@ -1,4 +1,9 @@ -import { Chunk, concreteChunk, Singleton, SingletonTypeId } from "@tsplus/stdlib/collections/Chunk/definition" +import { + Chunk, + concreteChunk, + Singleton, + SingletonTypeId +} from "@tsplus/stdlib/collections/Chunk/definition" /** * Returns a chunk with the elements mapped by the specified function. diff --git a/packages/stdlib/_src/collections/Chunk/operations/reduce.ts b/packages/stdlib/_src/collections/Chunk/operations/reduce.ts index 6eb671d7..087c389d 100644 --- a/packages/stdlib/_src/collections/Chunk/operations/reduce.ts +++ b/packages/stdlib/_src/collections/Chunk/operations/reduce.ts @@ -1,4 +1,8 @@ -import { ArrTypeId, concreteChunk, SingletonTypeId } from "@tsplus/stdlib/collections/Chunk/definition" +import { + ArrTypeId, + concreteChunk, + SingletonTypeId +} from "@tsplus/stdlib/collections/Chunk/definition" /** * Folds over the elements in this chunk from the left. diff --git a/packages/stdlib/_src/collections/Chunk/operations/reduceRight.ts b/packages/stdlib/_src/collections/Chunk/operations/reduceRight.ts index ae4338b4..cb831219 100644 --- a/packages/stdlib/_src/collections/Chunk/operations/reduceRight.ts +++ b/packages/stdlib/_src/collections/Chunk/operations/reduceRight.ts @@ -1,4 +1,8 @@ -import { ArrTypeId, concreteChunk, SingletonTypeId } from "@tsplus/stdlib/collections/Chunk/definition" +import { + ArrTypeId, + concreteChunk, + SingletonTypeId +} from "@tsplus/stdlib/collections/Chunk/definition" /** * Folds over the elements in this chunk from the right. diff --git a/packages/stdlib/_src/collections/Chunk/operations/reduceRightWithIndex.ts b/packages/stdlib/_src/collections/Chunk/operations/reduceRightWithIndex.ts index c2328b30..16d7e39e 100644 --- a/packages/stdlib/_src/collections/Chunk/operations/reduceRightWithIndex.ts +++ b/packages/stdlib/_src/collections/Chunk/operations/reduceRightWithIndex.ts @@ -1,4 +1,8 @@ -import { ArrTypeId, concreteChunk, SingletonTypeId } from "@tsplus/stdlib/collections/Chunk/definition" +import { + ArrTypeId, + concreteChunk, + SingletonTypeId +} from "@tsplus/stdlib/collections/Chunk/definition" /** * Folds over the elements in this chunk from the right. diff --git a/packages/stdlib/_src/collections/Chunk/operations/reduceWithIndex.ts b/packages/stdlib/_src/collections/Chunk/operations/reduceWithIndex.ts index e376960e..035b7d05 100644 --- a/packages/stdlib/_src/collections/Chunk/operations/reduceWithIndex.ts +++ b/packages/stdlib/_src/collections/Chunk/operations/reduceWithIndex.ts @@ -1,4 +1,8 @@ -import { ArrTypeId, concreteChunk, SingletonTypeId } from "@tsplus/stdlib/collections/Chunk/definition" +import { + ArrTypeId, + concreteChunk, + SingletonTypeId +} from "@tsplus/stdlib/collections/Chunk/definition" /** * Folds over the elements in this chunk from the left. diff --git a/packages/stdlib/_src/collections/Chunk/operations/separateWithIndexF.ts b/packages/stdlib/_src/collections/Chunk/operations/separateWithIndexF.ts index 4c1f7be2..a2ca234a 100644 --- a/packages/stdlib/_src/collections/Chunk/operations/separateWithIndexF.ts +++ b/packages/stdlib/_src/collections/Chunk/operations/separateWithIndexF.ts @@ -1,7 +1,10 @@ /** * @tsplus static Chunk.Ops separateWithIndexF */ -export const separateWithIndexF = WiltableWithIndex.implementSeparateWithIndexF()( +export const separateWithIndexF = WiltableWithIndex.implementSeparateWithIndexF< + number, + Chunk.HKT +>()( (_: { A: A B: B diff --git a/packages/stdlib/_src/collections/HashMap/_internal/hashMap.ts b/packages/stdlib/_src/collections/HashMap/_internal/hashMap.ts index f653f6df..131e1ae0 100644 --- a/packages/stdlib/_src/collections/HashMap/_internal/hashMap.ts +++ b/packages/stdlib/_src/collections/HashMap/_internal/hashMap.ts @@ -1,4 +1,8 @@ -import { fromBitmap, hashFragment, toBitmap } from "@tsplus/stdlib/collections/HashMap/_internal/bitwise" +import { + fromBitmap, + hashFragment, + toBitmap +} from "@tsplus/stdlib/collections/HashMap/_internal/bitwise" import { SIZE } from "@tsplus/stdlib/collections/HashMap/_internal/config" import type { Node } from "@tsplus/stdlib/collections/HashMap/_internal/node" import { isEmptyNode } from "@tsplus/stdlib/collections/HashMap/_internal/node" diff --git a/packages/stdlib/_src/collections/HashMap/_internal/node.ts b/packages/stdlib/_src/collections/HashMap/_internal/node.ts index ff576d55..64b4d285 100644 --- a/packages/stdlib/_src/collections/HashMap/_internal/node.ts +++ b/packages/stdlib/_src/collections/HashMap/_internal/node.ts @@ -1,6 +1,18 @@ -import { arraySpliceIn, arraySpliceOut, arrayUpdate } from "@tsplus/stdlib/collections/HashMap/_internal/array" -import { fromBitmap, hashFragment, toBitmap } from "@tsplus/stdlib/collections/HashMap/_internal/bitwise" -import { MAX_INDEX_NODE, MIN_ARRAY_NODE, SIZE } from "@tsplus/stdlib/collections/HashMap/_internal/config" +import { + arraySpliceIn, + arraySpliceOut, + arrayUpdate +} from "@tsplus/stdlib/collections/HashMap/_internal/array" +import { + fromBitmap, + hashFragment, + toBitmap +} from "@tsplus/stdlib/collections/HashMap/_internal/bitwise" +import { + MAX_INDEX_NODE, + MIN_ARRAY_NODE, + SIZE +} from "@tsplus/stdlib/collections/HashMap/_internal/config" /** * @tsplus type HashMap.Node diff --git a/packages/stdlib/_src/collections/HashMap/operations/filter.ts b/packages/stdlib/_src/collections/HashMap/operations/filter.ts index b381dff6..d18ee209 100644 --- a/packages/stdlib/_src/collections/HashMap/operations/filter.ts +++ b/packages/stdlib/_src/collections/HashMap/operations/filter.ts @@ -4,7 +4,9 @@ * @tsplus static HashMap.Aspects filter * @tsplus pipeable HashMap filter */ -export function filter(f: Refinement): (self: HashMap) => HashMap +export function filter( + f: Refinement +): (self: HashMap) => HashMap export function filter(f: Predicate): (self: HashMap) => HashMap export function filter(f: Predicate) { return (self: HashMap): HashMap => self.filterWithIndex((_, a) => f(a)) diff --git a/packages/stdlib/_src/collections/HashMap/operations/forEachWithIndex.ts b/packages/stdlib/_src/collections/HashMap/operations/forEachWithIndex.ts index 16ebf09e..fc4d4d23 100644 --- a/packages/stdlib/_src/collections/HashMap/operations/forEachWithIndex.ts +++ b/packages/stdlib/_src/collections/HashMap/operations/forEachWithIndex.ts @@ -5,5 +5,6 @@ * @tsplus pipeable HashMap forEachWithIndex */ export function forEachWithIndex(f: (k: K, v: V) => void) { - return (self: HashMap): void => self.reduceWithIndex(undefined as void, (_, key, value) => f(key, value)) + return (self: HashMap): void => + self.reduceWithIndex(undefined as void, (_, key, value) => f(key, value)) } diff --git a/packages/stdlib/_src/collections/HashMap/operations/node.ts b/packages/stdlib/_src/collections/HashMap/operations/node.ts index 8aef2415..d86aaeaf 100644 --- a/packages/stdlib/_src/collections/HashMap/operations/node.ts +++ b/packages/stdlib/_src/collections/HashMap/operations/node.ts @@ -1,4 +1,8 @@ -import type { Cont, TraversalFn, VisitResult } from "@tsplus/stdlib/collections/HashMap/_internal/hashMap" +import type { + Cont, + TraversalFn, + VisitResult +} from "@tsplus/stdlib/collections/HashMap/_internal/hashMap" import { visitLazy as visitLazyInternal, visitLazyChildren as visitLazyChildrenInternal diff --git a/packages/stdlib/_src/collections/ImmutableArray/compactWithIndexF.ts b/packages/stdlib/_src/collections/ImmutableArray/compactWithIndexF.ts index 821f7f36..9f51c0e7 100644 --- a/packages/stdlib/_src/collections/ImmutableArray/compactWithIndexF.ts +++ b/packages/stdlib/_src/collections/ImmutableArray/compactWithIndexF.ts @@ -1,7 +1,10 @@ /** * @tsplus static ImmutableArray.Ops compactWithIndexF */ -export const compactWithIndexF = WitherableWithIndex.implementCompactWithIndexF()( +export const compactWithIndexF = WitherableWithIndex.implementCompactWithIndexF< + number, + ImmutableArray.HKT +>()( (_: { A: A B: B @@ -12,5 +15,7 @@ export const compactWithIndexF = WitherableWithIndex.implementCompactWithIndexF< (G: Applicative) => (f: (k: number, a: A) => HKT.Kind>) => (fa: ImmutableArray): HKT.Kind> => - G.map((self: ImmutableArray>) => self.compact)(ImmutableArray.forEachWithIndexF(G)(f)(fa)) + G.map((self: ImmutableArray>) => self.compact)( + ImmutableArray.forEachWithIndexF(G)(f)(fa) + ) ) diff --git a/packages/stdlib/_src/collections/ImmutableArray/concat.ts b/packages/stdlib/_src/collections/ImmutableArray/concat.ts index 705e706b..3bcb0e0b 100644 --- a/packages/stdlib/_src/collections/ImmutableArray/concat.ts +++ b/packages/stdlib/_src/collections/ImmutableArray/concat.ts @@ -4,7 +4,8 @@ * @tsplus pipeable ImmutableArray concat */ export function concat(that: ImmutableArray) { - return (self: ImmutableArray): ImmutableArray => new ImmutableArray([...self.array, ...that.array]) + return (self: ImmutableArray): ImmutableArray => + new ImmutableArray([...self.array, ...that.array]) } /** diff --git a/packages/stdlib/_src/collections/ImmutableArray/filter.ts b/packages/stdlib/_src/collections/ImmutableArray/filter.ts index e0e90c7c..db1b6e85 100644 --- a/packages/stdlib/_src/collections/ImmutableArray/filter.ts +++ b/packages/stdlib/_src/collections/ImmutableArray/filter.ts @@ -4,8 +4,11 @@ * @tsplus static ImmutableArray.Aspects filter * @tsplus pipeable ImmutableArray filter */ -export function filter(f: Refinement): (self: ImmutableArray) => ImmutableArray +export function filter( + f: Refinement +): (self: ImmutableArray) => ImmutableArray export function filter(f: Predicate): (self: ImmutableArray) => ImmutableArray export function filter(f: Predicate) { - return (self: ImmutableArray): ImmutableArray => new ImmutableArray(self.array.filter((a) => f(a))) + return (self: ImmutableArray): ImmutableArray => + new ImmutableArray(self.array.filter((a) => f(a))) } diff --git a/packages/stdlib/_src/collections/ImmutableArray/filterWithIndex.ts b/packages/stdlib/_src/collections/ImmutableArray/filterWithIndex.ts index 8ce6eb5e..03237ee7 100644 --- a/packages/stdlib/_src/collections/ImmutableArray/filterWithIndex.ts +++ b/packages/stdlib/_src/collections/ImmutableArray/filterWithIndex.ts @@ -7,7 +7,10 @@ export function filterWithIndex( f: (i: number, a: A) => a is B ): (self: ImmutableArray) => ImmutableArray -export function filterWithIndex(f: (i: number, a: A) => boolean): (self: ImmutableArray) => ImmutableArray +export function filterWithIndex( + f: (i: number, a: A) => boolean +): (self: ImmutableArray) => ImmutableArray export function filterWithIndex(f: (i: number, a: A) => boolean) { - return (self: ImmutableArray): ImmutableArray => new ImmutableArray(self.array.filter((a, i) => f(i, a))) + return (self: ImmutableArray): ImmutableArray => + new ImmutableArray(self.array.filter((a, i) => f(i, a))) } diff --git a/packages/stdlib/_src/collections/ImmutableArray/flatMap.ts b/packages/stdlib/_src/collections/ImmutableArray/flatMap.ts index 4bb8b85d..60b9c2e5 100644 --- a/packages/stdlib/_src/collections/ImmutableArray/flatMap.ts +++ b/packages/stdlib/_src/collections/ImmutableArray/flatMap.ts @@ -3,5 +3,6 @@ * @tsplus pipeable ImmutableArray flatMap */ export function flatMap(f: (a: A) => ImmutableArray) { - return (self: ImmutableArray): ImmutableArray => new ImmutableArray(self.array.flatMap(x => f(x).array)) + return (self: ImmutableArray): ImmutableArray => + new ImmutableArray(self.array.flatMap(x => f(x).array)) } diff --git a/packages/stdlib/_src/collections/ImmutableArray/forEachWithIndexF.ts b/packages/stdlib/_src/collections/ImmutableArray/forEachWithIndexF.ts index ef1f6581..37850d07 100644 --- a/packages/stdlib/_src/collections/ImmutableArray/forEachWithIndexF.ts +++ b/packages/stdlib/_src/collections/ImmutableArray/forEachWithIndexF.ts @@ -1,13 +1,18 @@ /** * @tsplus static ImmutableArray.Ops forEachWithIndexF */ -export const forEachWithIndexF = ForEachWithIndex.implementForEachWithIndexF()( +export const forEachWithIndexF = ForEachWithIndex.implementForEachWithIndexF< + number, + ImmutableArray.HKT +>()( (_) => (G) => (f) => (fa) => { const succeed = DSL.succeedF(G) - let base = succeed, typeof _.R, typeof _.E>(ImmutableArray.empty()) + let base = succeed, typeof _.R, typeof _.E>( + ImmutableArray.empty() + ) for (let i = 0; i < fa.array.length; i = i + 1) { base = G.map( ({ tuple: [bs, b] }: Tuple<[ImmutableArray, typeof _.B]>) => bs.append(b) diff --git a/packages/stdlib/_src/collections/ImmutableArray/get.ts b/packages/stdlib/_src/collections/ImmutableArray/get.ts index 598227d2..325fed96 100644 --- a/packages/stdlib/_src/collections/ImmutableArray/get.ts +++ b/packages/stdlib/_src/collections/ImmutableArray/get.ts @@ -4,5 +4,6 @@ * @tsplus pipeable ImmutableArray get */ export function get(index: number) { - return (self: ImmutableArray): Maybe> => Maybe.fromNullable(self.array[index]) + return (self: ImmutableArray): Maybe> => + Maybe.fromNullable(self.array[index]) } diff --git a/packages/stdlib/_src/collections/ImmutableArray/getEquivalence.ts b/packages/stdlib/_src/collections/ImmutableArray/getEquivalence.ts index 4b07cb0c..15bdfd74 100644 --- a/packages/stdlib/_src/collections/ImmutableArray/getEquivalence.ts +++ b/packages/stdlib/_src/collections/ImmutableArray/getEquivalence.ts @@ -9,6 +9,7 @@ */ export function getEquivalnce(E: Equivalence): Equivalence> { return Equivalence((xs, ys) => - xs === ys || (xs.array.length === ys.array.length && xs.array.every((x, i) => E.equals(x, ys.array[i]!))) + xs === ys || + (xs.array.length === ys.array.length && xs.array.every((x, i) => E.equals(x, ys.array[i]!))) ) } diff --git a/packages/stdlib/_src/collections/ImmutableArray/instances/ChainRec.ts b/packages/stdlib/_src/collections/ImmutableArray/instances/ChainRec.ts index 181301e2..958ef5e1 100644 --- a/packages/stdlib/_src/collections/ImmutableArray/instances/ChainRec.ts +++ b/packages/stdlib/_src/collections/ImmutableArray/instances/ChainRec.ts @@ -3,7 +3,10 @@ import type * as P from "@tsplus/stdlib/prelude/ChainRec" /** * @tsplus static ImmutableArray.Ops depthFirstChainRec */ -export function depthFirstChainRec(a: A, f: (a: A) => ImmutableArray>): ImmutableArray { +export function depthFirstChainRec( + a: A, + f: (a: A) => ImmutableArray> +): ImmutableArray { const todo: Array> = [...f(a)] const result: Array = [] @@ -29,7 +32,10 @@ export const DepthFirstChainRec = HKT.instance>({ /** * @tsplus static ImmutableArray.Ops breadthFirstChainRec */ -export function breadthFirstChainRec(a: A, f: (a: A) => ImmutableArray>): ImmutableArray { +export function breadthFirstChainRec( + a: A, + f: (a: A) => ImmutableArray> +): ImmutableArray { const initial = f(a) const todo: Array> = [] const result: Array = [] diff --git a/packages/stdlib/_src/collections/ImmutableArray/instances/PartitionMapWithIndex.ts b/packages/stdlib/_src/collections/ImmutableArray/instances/PartitionMapWithIndex.ts index 39eaea1e..49c303dc 100644 --- a/packages/stdlib/_src/collections/ImmutableArray/instances/PartitionMapWithIndex.ts +++ b/packages/stdlib/_src/collections/ImmutableArray/instances/PartitionMapWithIndex.ts @@ -3,6 +3,8 @@ import type * as P from "@tsplus/stdlib/prelude/PartitionMapWithIndex" /** * @tsplus static ImmutableArray.Ops PartitionMapWithIndex */ -export const PartitionMapWithIndex = HKT.instance>({ +export const PartitionMapWithIndex = HKT.instance< + P.PartitionMapWithIndex +>({ partitionMapWithIndex: ImmutableArray.$.partitionMapWithIndex }) diff --git a/packages/stdlib/_src/collections/ImmutableArray/instances/ReduceRightWithIndex.ts b/packages/stdlib/_src/collections/ImmutableArray/instances/ReduceRightWithIndex.ts index cd9e7bdb..44a0d298 100644 --- a/packages/stdlib/_src/collections/ImmutableArray/instances/ReduceRightWithIndex.ts +++ b/packages/stdlib/_src/collections/ImmutableArray/instances/ReduceRightWithIndex.ts @@ -3,6 +3,8 @@ import type * as P from "@tsplus/stdlib/prelude/ReduceRightWithIndex" /** * @tsplus static ImmutableArray.Ops ReduceRightWithIndex */ -export const ReduceRightWithIndex = HKT.instance>({ +export const ReduceRightWithIndex = HKT.instance< + P.ReduceRightWithIndex +>({ reduceRightWithIndex: (b, f) => (fa) => fa.array.reduceRight((b, a, i) => f(i, a, b), b) }) diff --git a/packages/stdlib/_src/collections/ImmutableArray/map.ts b/packages/stdlib/_src/collections/ImmutableArray/map.ts index ab3d114c..da8f2d04 100644 --- a/packages/stdlib/_src/collections/ImmutableArray/map.ts +++ b/packages/stdlib/_src/collections/ImmutableArray/map.ts @@ -3,5 +3,6 @@ * @tsplus pipeable ImmutableArray map */ export function map(f: (a: A, k: number) => B) { - return (self: ImmutableArray): ImmutableArray => new ImmutableArray(self.array.map((a, i) => f(a, i))) + return (self: ImmutableArray): ImmutableArray => + new ImmutableArray(self.array.map((a, i) => f(a, i))) } diff --git a/packages/stdlib/_src/collections/ImmutableArray/prepend.ts b/packages/stdlib/_src/collections/ImmutableArray/prepend.ts index fee23f4f..fdcbdb5a 100644 --- a/packages/stdlib/_src/collections/ImmutableArray/prepend.ts +++ b/packages/stdlib/_src/collections/ImmutableArray/prepend.ts @@ -12,7 +12,10 @@ export function prependOperatorStrict(a: A, self: ImmutableArray): NonEmpt * * @tsplus operator ImmutableArray > */ -export function prependOperator(a: A, self: ImmutableArray): NonEmptyImmutableArray { +export function prependOperator( + a: A, + self: ImmutableArray +): NonEmptyImmutableArray { return new ImmutableArray([a, ...self.array] as any) as NonEmptyImmutableArray } diff --git a/packages/stdlib/_src/collections/ImmutableArray/separate.ts b/packages/stdlib/_src/collections/ImmutableArray/separate.ts index 282b13c6..40007e70 100644 --- a/packages/stdlib/_src/collections/ImmutableArray/separate.ts +++ b/packages/stdlib/_src/collections/ImmutableArray/separate.ts @@ -1,7 +1,9 @@ /** * @tsplus getter ImmutableArray separate */ -export function separate(self: ImmutableArray>): Tuple<[ImmutableArray, ImmutableArray]> { +export function separate( + self: ImmutableArray> +): Tuple<[ImmutableArray, ImmutableArray]> { const left: Array = [] const right: Array = [] for (const element of self) { diff --git a/packages/stdlib/_src/collections/ImmutableArray/separateF.ts b/packages/stdlib/_src/collections/ImmutableArray/separateF.ts index 14ef751c..3ce7795d 100644 --- a/packages/stdlib/_src/collections/ImmutableArray/separateF.ts +++ b/packages/stdlib/_src/collections/ImmutableArray/separateF.ts @@ -11,6 +11,10 @@ export const separateF = Wiltable.implementSeparateF()( }) => (G: Applicative) => (f: (a: A) => HKT.Kind>) => - (fa: ImmutableArray): HKT.Kind, ImmutableArray]>> => - G.map((self: ImmutableArray>) => self.separate)(ImmutableArray.forEachF(G)(f)(fa)) + ( + fa: ImmutableArray + ): HKT.Kind, ImmutableArray]>> => + G.map((self: ImmutableArray>) => self.separate)( + ImmutableArray.forEachF(G)(f)(fa) + ) ) diff --git a/packages/stdlib/_src/collections/ImmutableArray/separateWithIndexF.ts b/packages/stdlib/_src/collections/ImmutableArray/separateWithIndexF.ts index 181098d8..62a18498 100644 --- a/packages/stdlib/_src/collections/ImmutableArray/separateWithIndexF.ts +++ b/packages/stdlib/_src/collections/ImmutableArray/separateWithIndexF.ts @@ -1,7 +1,10 @@ /** * @tsplus static ImmutableArray.Ops separateWithIndexF */ -export const separateWithIndexF = WiltableWithIndex.implementSeparateWithIndexF()( +export const separateWithIndexF = WiltableWithIndex.implementSeparateWithIndexF< + number, + ImmutableArray.HKT +>()( (_: { A: A B: B @@ -11,6 +14,10 @@ export const separateWithIndexF = WiltableWithIndex.implementSeparateWithIndexF< }) => (G: Applicative) => (f: (k: number, a: A) => HKT.Kind>) => - (fa: ImmutableArray): HKT.Kind, ImmutableArray]>> => - G.map((self: ImmutableArray>) => self.separate)(ImmutableArray.forEachWithIndexF(G)(f)(fa)) + ( + fa: ImmutableArray + ): HKT.Kind, ImmutableArray]>> => + G.map((self: ImmutableArray>) => self.separate)( + ImmutableArray.forEachWithIndexF(G)(f)(fa) + ) ) diff --git a/packages/stdlib/_src/collections/ImmutableArray/sort.ts b/packages/stdlib/_src/collections/ImmutableArray/sort.ts index 55d47e14..2316be1b 100644 --- a/packages/stdlib/_src/collections/ImmutableArray/sort.ts +++ b/packages/stdlib/_src/collections/ImmutableArray/sort.ts @@ -5,5 +5,6 @@ * @tsplus pipeable ImmutableArray sort */ export function sort(O: Ord) { - return (self: ImmutableArray): ImmutableArray => new ImmutableArray([...self].sort((x, y) => O.compare(x, y))) + return (self: ImmutableArray): ImmutableArray => + new ImmutableArray([...self].sort((x, y) => O.compare(x, y))) } diff --git a/packages/stdlib/_src/collections/ImmutableArray/union.ts b/packages/stdlib/_src/collections/ImmutableArray/union.ts index e101d10d..13917f86 100644 --- a/packages/stdlib/_src/collections/ImmutableArray/union.ts +++ b/packages/stdlib/_src/collections/ImmutableArray/union.ts @@ -6,5 +6,6 @@ * @tsplus pipeable ImmutableArray union */ export function union(E: Equivalence, that: ImmutableArray) { - return (self: ImmutableArray): ImmutableArray => self.concat(that.filter((a) => !self.elem(E, a))) + return (self: ImmutableArray): ImmutableArray => + self.concat(that.filter((a) => !self.elem(E, a))) } diff --git a/packages/stdlib/_src/collections/ImmutableArray/zip.ts b/packages/stdlib/_src/collections/ImmutableArray/zip.ts index 4823cbf7..9cf222b3 100644 --- a/packages/stdlib/_src/collections/ImmutableArray/zip.ts +++ b/packages/stdlib/_src/collections/ImmutableArray/zip.ts @@ -6,5 +6,6 @@ * @tsplus pipeable ImmutableArray zip */ export function zip(that: ImmutableArray) { - return (self: ImmutableArray): ImmutableArray> => self.zipWith(that, (a, b) => Tuple(a, b)) + return (self: ImmutableArray): ImmutableArray> => + self.zipWith(that, (a, b) => Tuple(a, b)) } diff --git a/packages/stdlib/_src/collections/ImmutableMap/filterMap.ts b/packages/stdlib/_src/collections/ImmutableMap/filterMap.ts index 0f753cf8..a8a8edae 100644 --- a/packages/stdlib/_src/collections/ImmutableMap/filterMap.ts +++ b/packages/stdlib/_src/collections/ImmutableMap/filterMap.ts @@ -6,5 +6,6 @@ * @tsplus pipeable ImmutableMap filterMap */ export function filterMap(pf: (value: V) => Maybe) { - return (self: ImmutableMap): ImmutableMap => self.filterMapWithIndex((_, value) => pf(value)) + return (self: ImmutableMap): ImmutableMap => + self.filterMapWithIndex((_, value) => pf(value)) } diff --git a/packages/stdlib/_src/collections/ImmutableQueue/_internal/ImmutableQueueInternal.ts b/packages/stdlib/_src/collections/ImmutableQueue/_internal/ImmutableQueueInternal.ts index 920be104..9f558470 100644 --- a/packages/stdlib/_src/collections/ImmutableQueue/_internal/ImmutableQueueInternal.ts +++ b/packages/stdlib/_src/collections/ImmutableQueue/_internal/ImmutableQueueInternal.ts @@ -22,6 +22,8 @@ export class ImmutableQueueInternal implements ImmutableQueue { /** * @tsplus macro remove */ -export function concreteImmutableQueue(_: ImmutableQueue): asserts _ is ImmutableQueueInternal { +export function concreteImmutableQueue( + _: ImmutableQueue +): asserts _ is ImmutableQueueInternal { // } diff --git a/packages/stdlib/_src/collections/ImmutableQueue/dequeue.ts b/packages/stdlib/_src/collections/ImmutableQueue/dequeue.ts index 76de6cc0..7d52d447 100644 --- a/packages/stdlib/_src/collections/ImmutableQueue/dequeue.ts +++ b/packages/stdlib/_src/collections/ImmutableQueue/dequeue.ts @@ -6,7 +6,9 @@ import { /** * @tsplus getter ImmutableQueue dequeue */ -export function dequeue(self: ImmutableQueue): Maybe, ImmutableQueue]>> { +export function dequeue( + self: ImmutableQueue +): Maybe, ImmutableQueue]>> { concreteImmutableQueue(self) const size = self.backingList.length if (size === 0) { diff --git a/packages/stdlib/_src/collections/ImmutableQueue/filter.ts b/packages/stdlib/_src/collections/ImmutableQueue/filter.ts index f8ea5b03..02004b62 100644 --- a/packages/stdlib/_src/collections/ImmutableQueue/filter.ts +++ b/packages/stdlib/_src/collections/ImmutableQueue/filter.ts @@ -7,7 +7,9 @@ import { * @tsplus static ImmutableQueue.Aspects filter * @tsplus pipeable ImmutableQueue filter */ -export function filter(f: Refinement): (self: ImmutableQueue) => ImmutableQueue +export function filter( + f: Refinement +): (self: ImmutableQueue) => ImmutableQueue export function filter(f: Predicate): (self: ImmutableQueue) => ImmutableQueue export function filter(f: Predicate) { return (self: ImmutableQueue): ImmutableQueue => { diff --git a/packages/stdlib/_src/collections/List/definition.ts b/packages/stdlib/_src/collections/List/definition.ts index cf0a6f1a..b2955451 100644 --- a/packages/stdlib/_src/collections/List/definition.ts +++ b/packages/stdlib/_src/collections/List/definition.ts @@ -12,6 +12,9 @@ export const ListTypeId = Symbol.for("@tsplus/collections/List") export type ListTypeId = typeof ListTypeId +export const _A = Symbol.for("@tsplus/collections/List/_A") +export type _A = typeof _A + /** * @tsplus type List */ @@ -51,6 +54,7 @@ export declare namespace List { */ export class Cons implements Collection, Equals { readonly _tag = "Cons" + readonly [_A]!: (_: never) => A readonly [ListTypeId] = ListTypeId constructor(readonly head: A, public tail: List) {} [Symbol.iterator](): Iterator { @@ -91,6 +95,7 @@ export class Cons implements Collection, Equals { */ export class Nil implements Collection, Equals { readonly _tag = "Nil" + readonly [_A]!: (_: never) => A readonly [ListTypeId] = ListTypeId; [Symbol.iterator](): Iterator { return { @@ -116,7 +121,7 @@ export const _Nil = new Nil() */ export function unify>( self: X -): List<[X] extends [List] ? A : never> { +): List<[X] extends [{ readonly [_A]: (_: never) => infer A }] ? A : never> { return self } @@ -172,7 +177,7 @@ export function equalsWith( f: (a: A, b: B) => boolean ) { return (self: List): boolean => { - if (self === that) { + if ((self as List) === that) { return true } else if (length(self) !== length(that)) { return false diff --git a/packages/stdlib/_src/collections/NonEmptyImmutableArray/concat.ts b/packages/stdlib/_src/collections/NonEmptyImmutableArray/concat.ts index febac6ca..6894472c 100644 --- a/packages/stdlib/_src/collections/NonEmptyImmutableArray/concat.ts +++ b/packages/stdlib/_src/collections/NonEmptyImmutableArray/concat.ts @@ -17,7 +17,13 @@ export function concatOperator( self: NonEmptyImmutableArray, that: NonEmptyImmutableArray ): NonEmptyImmutableArray -export function concatOperator(self: NonEmptyImmutableArray, that: ImmutableArray): NonEmptyImmutableArray -export function concatOperator(self: NonEmptyImmutableArray, that: ImmutableArray): NonEmptyImmutableArray { +export function concatOperator( + self: NonEmptyImmutableArray, + that: ImmutableArray +): NonEmptyImmutableArray +export function concatOperator( + self: NonEmptyImmutableArray, + that: ImmutableArray +): NonEmptyImmutableArray { return self & that } diff --git a/packages/stdlib/_src/collections/NonEmptyImmutableArray/from.ts b/packages/stdlib/_src/collections/NonEmptyImmutableArray/from.ts index faa6e0d9..18bb98f8 100644 --- a/packages/stdlib/_src/collections/NonEmptyImmutableArray/from.ts +++ b/packages/stdlib/_src/collections/NonEmptyImmutableArray/from.ts @@ -6,5 +6,7 @@ */ export function from(collection: Collection): Maybe> { const array = Array.from(collection) - return array.length === 0 ? Maybe.none : Maybe.some(new ImmutableArray(array as any) as NonEmptyImmutableArray) + return array.length === 0 ? + Maybe.none : + Maybe.some(new ImmutableArray(array as any) as NonEmptyImmutableArray) } diff --git a/packages/stdlib/_src/collections/NonEmptyImmutableArray/getEquivalence.ts b/packages/stdlib/_src/collections/NonEmptyImmutableArray/getEquivalence.ts index c6835db2..7e88c0eb 100644 --- a/packages/stdlib/_src/collections/NonEmptyImmutableArray/getEquivalence.ts +++ b/packages/stdlib/_src/collections/NonEmptyImmutableArray/getEquivalence.ts @@ -3,6 +3,7 @@ */ export function getEquivalence(E: Equivalence): Equivalence> { return Equivalence((xs, ys) => - xs === ys || (xs.array.length === ys.array.length && xs.array.every((x, i) => E.equals(x, ys.array[i]!))) + xs === ys || + (xs.array.length === ys.array.length && xs.array.every((x, i) => E.equals(x, ys.array[i]!))) ) } diff --git a/packages/stdlib/_src/collections/NonEmptyImmutableArray/make.ts b/packages/stdlib/_src/collections/NonEmptyImmutableArray/make.ts index d51b8092..a4e5bc13 100644 --- a/packages/stdlib/_src/collections/NonEmptyImmutableArray/make.ts +++ b/packages/stdlib/_src/collections/NonEmptyImmutableArray/make.ts @@ -4,6 +4,9 @@ * @tsplus static NonEmptyImmutableArray.Ops __call * @tsplus static NonEmptyImmutableArray.Ops make */ -export function make(head: As[number], ...rest: As): NonEmptyImmutableArray { +export function make( + head: As[number], + ...rest: As +): NonEmptyImmutableArray { return new ImmutableArray([head, ...rest]) as NonEmptyImmutableArray } diff --git a/packages/stdlib/_src/collections/ParSeq/flatMap.ts b/packages/stdlib/_src/collections/ParSeq/flatMap.ts index 5c141e2a..847cd835 100644 --- a/packages/stdlib/_src/collections/ParSeq/flatMap.ts +++ b/packages/stdlib/_src/collections/ParSeq/flatMap.ts @@ -6,5 +6,6 @@ * @tsplus pipeable ParSeq flatMap */ export function flatMap(f: (a: A) => ParSeq) { - return (self: ParSeq): ParSeq => self.fold(ParSeq.empty(), f, ParSeq.combineSeq, ParSeq.combinePar) + return (self: ParSeq): ParSeq => + self.fold(ParSeq.empty(), f, ParSeq.combineSeq, ParSeq.combinePar) } diff --git a/packages/stdlib/_src/collections/RedBlackTree/_internal/RedBlackTreeInternal.ts b/packages/stdlib/_src/collections/RedBlackTree/_internal/RedBlackTreeInternal.ts index 2eaedf64..91cf00de 100644 --- a/packages/stdlib/_src/collections/RedBlackTree/_internal/RedBlackTreeInternal.ts +++ b/packages/stdlib/_src/collections/RedBlackTree/_internal/RedBlackTreeInternal.ts @@ -1,5 +1,10 @@ import type { RedBlackTree } from "@tsplus/stdlib/collections/RedBlackTree/definition" -import { _K, _V, RedBlackTreeIterator, RedBlackTreeSym } from "@tsplus/stdlib/collections/RedBlackTree/definition" +import { + _K, + _V, + RedBlackTreeIterator, + RedBlackTreeSym +} from "@tsplus/stdlib/collections/RedBlackTree/definition" import type { Node } from "@tsplus/stdlib/collections/RedBlackTree/node" export class RedBlackTreeInternal implements RedBlackTree { diff --git a/packages/stdlib/_src/collections/RedBlackTree/at.ts b/packages/stdlib/_src/collections/RedBlackTree/at.ts index 618ab63b..fb02e6c2 100644 --- a/packages/stdlib/_src/collections/RedBlackTree/at.ts +++ b/packages/stdlib/_src/collections/RedBlackTree/at.ts @@ -1,4 +1,7 @@ -import type { Direction, RedBlackTreeIterable } from "@tsplus/stdlib/collections/RedBlackTree/definition" +import type { + Direction, + RedBlackTreeIterable +} from "@tsplus/stdlib/collections/RedBlackTree/definition" import { RedBlackTreeIterator } from "@tsplus/stdlib/collections/RedBlackTree/definition" import type { Node } from "@tsplus/stdlib/collections/RedBlackTree/node" diff --git a/packages/stdlib/_src/collections/RedBlackTree/ge.ts b/packages/stdlib/_src/collections/RedBlackTree/ge.ts index 9ef32f4b..86f2c7f8 100644 --- a/packages/stdlib/_src/collections/RedBlackTree/ge.ts +++ b/packages/stdlib/_src/collections/RedBlackTree/ge.ts @@ -1,4 +1,7 @@ -import type { Direction, RedBlackTreeIterable } from "@tsplus/stdlib/collections/RedBlackTree/definition" +import type { + Direction, + RedBlackTreeIterable +} from "@tsplus/stdlib/collections/RedBlackTree/definition" import { RedBlackTreeIterator } from "@tsplus/stdlib/collections/RedBlackTree/definition" /** diff --git a/packages/stdlib/_src/collections/RedBlackTree/gt.ts b/packages/stdlib/_src/collections/RedBlackTree/gt.ts index 1f0234b1..b583a6aa 100644 --- a/packages/stdlib/_src/collections/RedBlackTree/gt.ts +++ b/packages/stdlib/_src/collections/RedBlackTree/gt.ts @@ -1,4 +1,7 @@ -import type { Direction, RedBlackTreeIterable } from "@tsplus/stdlib/collections/RedBlackTree/definition" +import type { + Direction, + RedBlackTreeIterable +} from "@tsplus/stdlib/collections/RedBlackTree/definition" import { RedBlackTreeIterator } from "@tsplus/stdlib/collections/RedBlackTree/definition" /** diff --git a/packages/stdlib/_src/collections/RedBlackTree/le.ts b/packages/stdlib/_src/collections/RedBlackTree/le.ts index b354ff9a..6b46f027 100644 --- a/packages/stdlib/_src/collections/RedBlackTree/le.ts +++ b/packages/stdlib/_src/collections/RedBlackTree/le.ts @@ -1,4 +1,7 @@ -import type { Direction, RedBlackTreeIterable } from "@tsplus/stdlib/collections/RedBlackTree/definition" +import type { + Direction, + RedBlackTreeIterable +} from "@tsplus/stdlib/collections/RedBlackTree/definition" import { RedBlackTreeIterator } from "@tsplus/stdlib/collections/RedBlackTree/definition" /** diff --git a/packages/stdlib/_src/collections/RedBlackTree/lt.ts b/packages/stdlib/_src/collections/RedBlackTree/lt.ts index 9ac190f3..29d1469e 100644 --- a/packages/stdlib/_src/collections/RedBlackTree/lt.ts +++ b/packages/stdlib/_src/collections/RedBlackTree/lt.ts @@ -1,4 +1,7 @@ -import type { Direction, RedBlackTreeIterable } from "@tsplus/stdlib/collections/RedBlackTree/definition" +import type { + Direction, + RedBlackTreeIterable +} from "@tsplus/stdlib/collections/RedBlackTree/definition" import { RedBlackTreeIterator } from "@tsplus/stdlib/collections/RedBlackTree/definition" /** diff --git a/packages/stdlib/_src/collections/RedBlackTree/make.ts b/packages/stdlib/_src/collections/RedBlackTree/make.ts index 431df33f..bf3a624c 100644 --- a/packages/stdlib/_src/collections/RedBlackTree/make.ts +++ b/packages/stdlib/_src/collections/RedBlackTree/make.ts @@ -6,7 +6,9 @@ */ export function make[]>( ord: Ord -): (...entries: Entries) => RedBlackTree ? V : never> { +): ( + ...entries: Entries +) => RedBlackTree ? V : never> { return (...entries: Entries) => RedBlackTree.from ? V : never>(ord)(entries) } diff --git a/packages/stdlib/_src/collections/SortedMap/remove.ts b/packages/stdlib/_src/collections/SortedMap/remove.ts index 32e5e012..278a2c4e 100644 --- a/packages/stdlib/_src/collections/SortedMap/remove.ts +++ b/packages/stdlib/_src/collections/SortedMap/remove.ts @@ -1,4 +1,7 @@ -import { concreteSortedMap, SortedMapInternal } from "@tsplus/stdlib/collections/SortedMap/_internal/SortedMapInternal" +import { + concreteSortedMap, + SortedMapInternal +} from "@tsplus/stdlib/collections/SortedMap/_internal/SortedMapInternal" /** * @tsplus fluent SortedMap remove diff --git a/packages/stdlib/_src/collections/SortedMap/set.ts b/packages/stdlib/_src/collections/SortedMap/set.ts index d978538b..4141d788 100644 --- a/packages/stdlib/_src/collections/SortedMap/set.ts +++ b/packages/stdlib/_src/collections/SortedMap/set.ts @@ -1,4 +1,7 @@ -import { concreteSortedMap, SortedMapInternal } from "@tsplus/stdlib/collections/SortedMap/_internal/SortedMapInternal" +import { + concreteSortedMap, + SortedMapInternal +} from "@tsplus/stdlib/collections/SortedMap/_internal/SortedMapInternal" /** * @tsplus static SortedMap.Aspects set diff --git a/packages/stdlib/_src/collections/SortedSet/add.ts b/packages/stdlib/_src/collections/SortedSet/add.ts index 5b42ed74..2710c95a 100644 --- a/packages/stdlib/_src/collections/SortedSet/add.ts +++ b/packages/stdlib/_src/collections/SortedSet/add.ts @@ -1,4 +1,7 @@ -import { concreteSortedSet, SortedSetInternal } from "@tsplus/stdlib/collections/SortedSet/_internal/SortedSetInternal" +import { + concreteSortedSet, + SortedSetInternal +} from "@tsplus/stdlib/collections/SortedSet/_internal/SortedSetInternal" /** * @tsplus pipeable-operator SortedSet + diff --git a/packages/stdlib/_src/collections/SortedSet/remove.ts b/packages/stdlib/_src/collections/SortedSet/remove.ts index e0f140a2..9fb130b8 100644 --- a/packages/stdlib/_src/collections/SortedSet/remove.ts +++ b/packages/stdlib/_src/collections/SortedSet/remove.ts @@ -1,4 +1,7 @@ -import { concreteSortedSet, SortedSetInternal } from "@tsplus/stdlib/collections/SortedSet/_internal/SortedSetInternal" +import { + concreteSortedSet, + SortedSetInternal +} from "@tsplus/stdlib/collections/SortedSet/_internal/SortedSetInternal" /** * @tsplus pipeable-operator SortedSet - diff --git a/packages/stdlib/_src/collections/SortedSet/toggle.ts b/packages/stdlib/_src/collections/SortedSet/toggle.ts index 79346972..af46a19d 100644 --- a/packages/stdlib/_src/collections/SortedSet/toggle.ts +++ b/packages/stdlib/_src/collections/SortedSet/toggle.ts @@ -6,5 +6,6 @@ * @tsplus pipeable SortedSet toggle */ export function toggle(value: A) { - return (self: SortedSet): SortedSet => self.has(value) ? self.remove(value) : self.add(value) + return (self: SortedSet): SortedSet => + self.has(value) ? self.remove(value) : self.add(value) } diff --git a/packages/stdlib/_src/collections/mutable/MutableQueue/_internal/Bounded.ts b/packages/stdlib/_src/collections/mutable/MutableQueue/_internal/Bounded.ts index 1c5a878b..a8956712 100644 --- a/packages/stdlib/_src/collections/mutable/MutableQueue/_internal/Bounded.ts +++ b/packages/stdlib/_src/collections/mutable/MutableQueue/_internal/Bounded.ts @@ -1,4 +1,7 @@ -import { EmptyMutableQueue, MutableQueueSym } from "@tsplus/stdlib/collections/mutable/MutableQueue/definition" +import { + EmptyMutableQueue, + MutableQueueSym +} from "@tsplus/stdlib/collections/mutable/MutableQueue/definition" export class Bounded implements MutableQueue { readonly [MutableQueueSym]: MutableQueueSym = MutableQueueSym diff --git a/packages/stdlib/_src/collections/mutable/MutableQueue/_internal/Unbounded.ts b/packages/stdlib/_src/collections/mutable/MutableQueue/_internal/Unbounded.ts index 53f2ac00..6010576d 100644 --- a/packages/stdlib/_src/collections/mutable/MutableQueue/_internal/Unbounded.ts +++ b/packages/stdlib/_src/collections/mutable/MutableQueue/_internal/Unbounded.ts @@ -1,4 +1,7 @@ -import { EmptyMutableQueue, MutableQueueSym } from "@tsplus/stdlib/collections/mutable/MutableQueue/definition" +import { + EmptyMutableQueue, + MutableQueueSym +} from "@tsplus/stdlib/collections/mutable/MutableQueue/definition" export class Unbounded implements MutableQueue { readonly [MutableQueueSym]: MutableQueueSym = MutableQueueSym diff --git a/packages/stdlib/_src/collections/weak/IterableWeakMap.ts b/packages/stdlib/_src/collections/weak/IterableWeakMap.ts index 97a7e508..e250abfa 100644 --- a/packages/stdlib/_src/collections/weak/IterableWeakMap.ts +++ b/packages/stdlib/_src/collections/weak/IterableWeakMap.ts @@ -46,7 +46,8 @@ export interface IterableWeakMapAspects {} * @tsplus pipeable IterableWeakMap getMaybe */ export function getMaybe(key: K) { - return (self: IterableWeakMap): Maybe => self.has(key) ? Maybe.some(self.get(key)!) : Maybe.none + return (self: IterableWeakMap): Maybe => + self.has(key) ? Maybe.some(self.get(key)!) : Maybe.none } /** diff --git a/packages/stdlib/_src/data/Either/definition.ts b/packages/stdlib/_src/data/Either/definition.ts index 4b67b70b..e94c8aff 100644 --- a/packages/stdlib/_src/data/Either/definition.ts +++ b/packages/stdlib/_src/data/Either/definition.ts @@ -76,8 +76,8 @@ export class Right implements Equals { export function unifyEither>( self: X ): Either< - [X] extends [Either] ? EX : never, - [X] extends [Either] ? AX : never + X extends Left ? EX : never, + X extends Right ? AX : never > { return self } diff --git a/packages/stdlib/_src/data/Either/forEachF.ts b/packages/stdlib/_src/data/Either/forEachF.ts index e4a4008a..0c22f304 100644 --- a/packages/stdlib/_src/data/Either/forEachF.ts +++ b/packages/stdlib/_src/data/Either/forEachF.ts @@ -1,7 +1,11 @@ /** * @tsplus static Either.Ops forEachF */ -export const forEachF: ForEach.Fn = (G: IdentityBoth & Covariant) => +export const forEachF: ForEach.Fn = ( + G: IdentityBoth & Covariant +) => (f: (a: A) => HKT.Kind) => - (fa: HKT.Kind): HKT.Kind> => + ( + fa: HKT.Kind + ): HKT.Kind> => fa.isLeft() ? DSL.succeedF(G)(fa) : G.map((b: B) => Either.right(b))(f(fa.right)) diff --git a/packages/stdlib/_src/data/Either/getAssociative.ts b/packages/stdlib/_src/data/Either/getAssociative.ts index 7f77c6f5..c7fd6672 100644 --- a/packages/stdlib/_src/data/Either/getAssociative.ts +++ b/packages/stdlib/_src/data/Either/getAssociative.ts @@ -4,5 +4,7 @@ * @tsplus static Either.Ops getAssociative */ export function getAssociative(S: Associative): Associative> { - return Associative((x, y) => y.isLeft() ? x : x.isLeft() ? y : Either.right(S.combine(x.right, y.right))) + return Associative((x, y) => + y.isLeft() ? x : x.isLeft() ? y : Either.right(S.combine(x.right, y.right)) + ) } diff --git a/packages/stdlib/_src/data/Either/getEquivalence.ts b/packages/stdlib/_src/data/Either/getEquivalence.ts index 117deb9e..0fca3ac0 100644 --- a/packages/stdlib/_src/data/Either/getEquivalence.ts +++ b/packages/stdlib/_src/data/Either/getEquivalence.ts @@ -1,4 +1,7 @@ -export function getEquivalence(EE: Equivalence, EA: Equivalence): Equivalence> { +export function getEquivalence( + EE: Equivalence, + EA: Equivalence +): Equivalence> { return Equivalence((x, y) => x === y || (x.isLeft() ? diff --git a/packages/stdlib/_src/data/Either/getShow.ts b/packages/stdlib/_src/data/Either/getShow.ts index bc510721..a6c0259d 100644 --- a/packages/stdlib/_src/data/Either/getShow.ts +++ b/packages/stdlib/_src/data/Either/getShow.ts @@ -2,5 +2,7 @@ * @tsplus static Either.Ops getShow */ export function getShow(SE: Show, SA: Show): Show> { - return Show((either) => either.isLeft() ? `Left(${SE.show(either.left)})` : `Right(${SA.show(either.right)})`) + return Show((either) => + either.isLeft() ? `Left(${SE.show(either.left)})` : `Right(${SA.show(either.right)})` + ) } diff --git a/packages/stdlib/_src/data/Either/instances/AssociativeEither.ts b/packages/stdlib/_src/data/Either/instances/AssociativeEither.ts index 83d67ec9..d39ee532 100644 --- a/packages/stdlib/_src/data/Either/instances/AssociativeEither.ts +++ b/packages/stdlib/_src/data/Either/instances/AssociativeEither.ts @@ -4,5 +4,6 @@ import type * as P from "@tsplus/stdlib/prelude/AssociativeEither" * @tsplus static Either.Ops AssociativeEither */ export const AssociativeEither = HKT.instance>({ - orElseEither: (fb) => (fa) => fa._tag === "Right" ? Either.right(Either.left(fa.right)) : fb().map(Either.right) + orElseEither: (fb) => + (fa) => fa._tag === "Right" ? Either.right(Either.left(fa.right)) : fb().map(Either.right) }) diff --git a/packages/stdlib/_src/data/Either/mapBoth.ts b/packages/stdlib/_src/data/Either/mapBoth.ts index 91a060be..0c3b6fd3 100644 --- a/packages/stdlib/_src/data/Either/mapBoth.ts +++ b/packages/stdlib/_src/data/Either/mapBoth.ts @@ -5,5 +5,6 @@ * @tsplus pipeable Either mapBoth */ export function mapBoth(f: (e: E) => E1, g: (a: A) => B) { - return (self: Either): Either => self.isLeft() ? Either.left(f(self.left)) : Either.right(g(self.right)) + return (self: Either): Either => + self.isLeft() ? Either.left(f(self.left)) : Either.right(g(self.right)) } diff --git a/packages/stdlib/_src/data/Function/pipe.ts b/packages/stdlib/_src/data/Function/pipe.ts index 64b6ee89..fb26c69f 100644 --- a/packages/stdlib/_src/data/Function/pipe.ts +++ b/packages/stdlib/_src/data/Function/pipe.ts @@ -311,9 +311,13 @@ export function pipe( case 18: return qr!(pq!(op!(no!(mn!(lm!(kl!(jk!(ij!(hi!(gh!(fg!(ef!(de!(cd!(bc!(ab!(a))))))))))))))))) case 19: - return rs!(qr!(pq!(op!(no!(mn!(lm!(kl!(jk!(ij!(hi!(gh!(fg!(ef!(de!(cd!(bc!(ab!(a)))))))))))))))))) + return rs!( + qr!(pq!(op!(no!(mn!(lm!(kl!(jk!(ij!(hi!(gh!(fg!(ef!(de!(cd!(bc!(ab!(a))))))))))))))))) + ) case 20: - return st!(rs!(qr!(pq!(op!(no!(mn!(lm!(kl!(jk!(ij!(hi!(gh!(fg!(ef!(de!(cd!(bc!(ab!(a))))))))))))))))))) + return st!( + rs!(qr!(pq!(op!(no!(mn!(lm!(kl!(jk!(ij!(hi!(gh!(fg!(ef!(de!(cd!(bc!(ab!(a)))))))))))))))))) + ) default: throw new Error("BUG: pipe() has been called with more than 20 arguments") } diff --git a/packages/stdlib/_src/data/Maybe/definition.ts b/packages/stdlib/_src/data/Maybe/definition.ts index f1eb0194..d71a76b4 100644 --- a/packages/stdlib/_src/data/Maybe/definition.ts +++ b/packages/stdlib/_src/data/Maybe/definition.ts @@ -69,7 +69,7 @@ export class Some implements Equals { */ export function unifyMaybe>( self: X -): Maybe<[X] extends [Maybe] ? A : never> { +): Maybe ? A : never> { return self } diff --git a/packages/stdlib/_src/data/Maybe/dsl/do.ts b/packages/stdlib/_src/data/Maybe/dsl/do.ts index 05f10f64..2deaf8ff 100644 --- a/packages/stdlib/_src/data/Maybe/dsl/do.ts +++ b/packages/stdlib/_src/data/Maybe/dsl/do.ts @@ -13,7 +13,9 @@ export function bind( name: N extends keyof Scope ? { error: `binding name '${N}' already in use` } : N, f: (_: Scope) => Maybe ) { - return (self: Maybe): Maybe<{ readonly [k in N | keyof Scope]: k extends keyof Scope ? Scope[k] : A }> => + return ( + self: Maybe + ): Maybe<{ readonly [k in N | keyof Scope]: k extends keyof Scope ? Scope[k] : A }> => DoF.bind(name, f)(self) } @@ -25,6 +27,8 @@ export function bindValue( name: N extends keyof Scope ? { error: `binding name '${N}' already in use` } : N, f: (_: Scope) => B ) { - return (self: Maybe): Maybe<{ readonly [k in N | keyof Scope]: k extends keyof Scope ? Scope[k] : B }> => + return ( + self: Maybe + ): Maybe<{ readonly [k in N | keyof Scope]: k extends keyof Scope ? Scope[k] : B }> => DoF.bindValue(name, f)(self) } diff --git a/packages/stdlib/_src/data/Maybe/dsl/forEachF.ts b/packages/stdlib/_src/data/Maybe/dsl/forEachF.ts index e578e093..c4c8298f 100644 --- a/packages/stdlib/_src/data/Maybe/dsl/forEachF.ts +++ b/packages/stdlib/_src/data/Maybe/dsl/forEachF.ts @@ -13,6 +13,8 @@ export const forEachF = ForEach.implementForEachF()( (G: AssociativeBoth & Any & Covariant) => (f: (a: A) => HKT.Kind) => (fa: Maybe): HKT.Kind> => { - return fa.isNone() ? DSL.succeedF(G)(Maybe.none) : G.map((b: B) => Maybe.some(b))(f(fa.value)) + return fa.isNone() ? + DSL.succeedF(G)(Maybe.none) : + G.map((b: B) => Maybe.some(b))(f(fa.value)) } ) diff --git a/packages/stdlib/_src/data/Maybe/filter.ts b/packages/stdlib/_src/data/Maybe/filter.ts index 0df00836..b76b8bcd 100644 --- a/packages/stdlib/_src/data/Maybe/filter.ts +++ b/packages/stdlib/_src/data/Maybe/filter.ts @@ -5,5 +5,6 @@ export function filter(f: Refinement): (self: Maybe) => Maybe export function filter(f: Predicate): (self: Maybe) => Maybe export function filter(f: Predicate) { - return (self: Maybe): Maybe => self.isNone() ? Maybe.none : f(self.value) ? self : Maybe.none + return (self: Maybe): Maybe => + self.isNone() ? Maybe.none : f(self.value) ? self : Maybe.none } diff --git a/packages/stdlib/_src/data/Maybe/getAssociative.ts b/packages/stdlib/_src/data/Maybe/getAssociative.ts index 8c13c20f..afc3b7c8 100644 --- a/packages/stdlib/_src/data/Maybe/getAssociative.ts +++ b/packages/stdlib/_src/data/Maybe/getAssociative.ts @@ -12,5 +12,7 @@ export function getAssociative(S: Associative | "First" | "Last"): Associa return Associative((x, y) => (y.isNone() ? x : y)) } } - return Associative((x, y) => x.isSome() && y.isSome() ? Maybe.some(S.combine(x.value, y.value)) : Maybe.none) + return Associative((x, y) => + x.isSome() && y.isSome() ? Maybe.some(S.combine(x.value, y.value)) : Maybe.none + ) } diff --git a/packages/stdlib/_src/data/Maybe/getEquivalence.ts b/packages/stdlib/_src/data/Maybe/getEquivalence.ts index acb9de43..13117dba 100644 --- a/packages/stdlib/_src/data/Maybe/getEquivalence.ts +++ b/packages/stdlib/_src/data/Maybe/getEquivalence.ts @@ -2,5 +2,7 @@ * @tsplus static Maybe.Ops getEquivalence */ export function getEquivalence(E: Equivalence): Equivalence> { - return Equivalence((x, y) => x === y || x.isNone() ? y.isNone() : y.isNone() ? false : E.equals(x.value, y.value)) + return Equivalence((x, y) => + x === y || x.isNone() ? y.isNone() : y.isNone() ? false : E.equals(x.value, y.value) + ) } diff --git a/packages/stdlib/_src/data/Maybe/mapNullable.ts b/packages/stdlib/_src/data/Maybe/mapNullable.ts index e2052581..b1fb0ca5 100644 --- a/packages/stdlib/_src/data/Maybe/mapNullable.ts +++ b/packages/stdlib/_src/data/Maybe/mapNullable.ts @@ -5,5 +5,6 @@ * @tsplus pipeable Maybe mapNullable */ export function mapNullable(f: (a: A) => B | null | undefined) { - return (self: Maybe): Maybe => self.isNone() ? Maybe.none : Maybe.fromNullable(f(self.value)) + return (self: Maybe): Maybe => + self.isNone() ? Maybe.none : Maybe.fromNullable(f(self.value)) } diff --git a/packages/stdlib/_src/data/Maybe/partition.ts b/packages/stdlib/_src/data/Maybe/partition.ts index cfa63e0c..5b656c95 100644 --- a/packages/stdlib/_src/data/Maybe/partition.ts +++ b/packages/stdlib/_src/data/Maybe/partition.ts @@ -2,8 +2,11 @@ * @tsplus static Maybe.Aspects partition * @tsplus pipeable Maybe partition */ -export function partition(f: Refinement): (self: Maybe) => Tuple<[Maybe, Maybe]> +export function partition( + f: Refinement +): (self: Maybe) => Tuple<[Maybe, Maybe]> export function partition(f: Predicate): (self: Maybe) => Tuple<[Maybe, Maybe]> export function partition(f: Predicate) { - return (self: Maybe): Tuple<[Maybe, Maybe]> => Tuple(self.filter((a) => !f(a)), self.filter(f)) + return (self: Maybe): Tuple<[Maybe, Maybe]> => + Tuple(self.filter((a) => !f(a)), self.filter(f)) } diff --git a/packages/stdlib/_src/data/Maybe/zip.ts b/packages/stdlib/_src/data/Maybe/zip.ts index cc200e19..cdd7258e 100644 --- a/packages/stdlib/_src/data/Maybe/zip.ts +++ b/packages/stdlib/_src/data/Maybe/zip.ts @@ -6,5 +6,6 @@ * @tsplus pipeable Maybe zip */ export function zip(that: Maybe) { - return (self: Maybe): Maybe> => self.flatMap((a) => that.map((b) => Tuple(a, b))) + return (self: Maybe): Maybe> => + self.flatMap((a) => that.map((b) => Tuple(a, b))) } diff --git a/packages/stdlib/_src/data/Tuple/mergeTuple.ts b/packages/stdlib/_src/data/Tuple/mergeTuple.ts index 3242261a..30d8d560 100644 --- a/packages/stdlib/_src/data/Tuple/mergeTuple.ts +++ b/packages/stdlib/_src/data/Tuple/mergeTuple.ts @@ -1,5 +1,6 @@ -export type MergeTuple = A extends Tuple ? B extends Tuple ? Tuple<[...TA, ...TB]> -: Tuple<[...TA, B]> +export type MergeTuple = A extends Tuple + ? B extends Tuple ? Tuple<[...TA, ...TB]> + : Tuple<[...TA, B]> : B extends Tuple ? Tuple<[A, ...TB]> : Tuple<[A, B]> diff --git a/packages/stdlib/_src/global.ts b/packages/stdlib/_src/global.ts index e8454ff7..79b73450 100644 --- a/packages/stdlib/_src/global.ts +++ b/packages/stdlib/_src/global.ts @@ -428,7 +428,13 @@ import { Check, TypeLevel } from "@tsplus/stdlib/type-level" /** * @tsplus global */ -import { isDefined, isIterable, isPlainObject, isPromiseLike, isReactElement } from "@tsplus/stdlib/utilities/Guards" +import { + isDefined, + isIterable, + isPlainObject, + isPromiseLike, + isReactElement +} from "@tsplus/stdlib/utilities/Guards" /** * @tsplus global */ diff --git a/packages/stdlib/_src/io/Eval.ts b/packages/stdlib/_src/io/Eval.ts index 1fca6595..a70ebe81 100644 --- a/packages/stdlib/_src/io/Eval.ts +++ b/packages/stdlib/_src/io/Eval.ts @@ -1,6 +1,8 @@ // codegen:start {preset: barrel, include: ./Eval/*.ts, prefix: "@tsplus/stdlib/io"} export * from "@tsplus/stdlib/io/Eval/definition" +export * from "@tsplus/stdlib/io/Eval/extend" export * from "@tsplus/stdlib/io/Eval/flatMap" +export * from "@tsplus/stdlib/io/Eval/flatten" export * from "@tsplus/stdlib/io/Eval/gen" export * from "@tsplus/stdlib/io/Eval/instances" export * from "@tsplus/stdlib/io/Eval/map" diff --git a/packages/stdlib/_src/io/Eval/definition.ts b/packages/stdlib/_src/io/Eval/definition.ts index 51e6b7ac..6c5a44a7 100644 --- a/packages/stdlib/_src/io/Eval/definition.ts +++ b/packages/stdlib/_src/io/Eval/definition.ts @@ -42,7 +42,9 @@ export interface EvalAspects {} /** * @tsplus unify Eval */ -export function unifyEval>(self: X): Eval<[X] extends [Eval] ? AX : never> { +export function unifyEval>( + self: X +): Eval<[X] extends [Eval] ? AX : never> { return self } diff --git a/packages/stdlib/_src/io/Eval/flatMap.ts b/packages/stdlib/_src/io/Eval/flatMap.ts index 13ab6a52..615a6fb4 100644 --- a/packages/stdlib/_src/io/Eval/flatMap.ts +++ b/packages/stdlib/_src/io/Eval/flatMap.ts @@ -10,5 +10,6 @@ import { FlatMap } from "@tsplus/stdlib/io/Eval/definition" * @tsplus pipeable Eval flatMap */ export function flatMap(f: (a: A) => Eval) { - return (self: Eval): Eval => new FlatMap(self as EvalInternal, f as (a: A) => EvalInternal) + return (self: Eval): Eval => + new FlatMap(self as EvalInternal, f as (a: A) => EvalInternal) } diff --git a/packages/stdlib/_src/io/Eval/instances/AssociativeBoth.ts b/packages/stdlib/_src/io/Eval/instances/AssociativeBoth.ts index d4a8e786..a41df3a1 100644 --- a/packages/stdlib/_src/io/Eval/instances/AssociativeBoth.ts +++ b/packages/stdlib/_src/io/Eval/instances/AssociativeBoth.ts @@ -4,5 +4,5 @@ import type * as P from "@tsplus/stdlib/prelude/AssociativeBoth" * @tsplus static Eval.Ops AssociativeBoth */ export const AssociativeBoth = HKT.instance>({ - both: (that) => Eval.$.zip(() => that) + both: (that) => Eval.$.zip(that) }) diff --git a/packages/stdlib/_src/io/Eval/reduce.ts b/packages/stdlib/_src/io/Eval/reduce.ts index 5cfb01fc..3fcec92f 100644 --- a/packages/stdlib/_src/io/Eval/reduce.ts +++ b/packages/stdlib/_src/io/Eval/reduce.ts @@ -1,6 +1,10 @@ /** * @tsplus static Eval.Ops reduce */ -export function reduce(as: Collection, b: LazyArg, f: (b: B, a: A) => Eval): Eval { +export function reduce( + as: Collection, + b: LazyArg, + f: (b: B, a: A) => Eval +): Eval { return as.reduce(Eval.succeed(b), (b, a) => b.flatMap((b) => f(b, a))) } diff --git a/packages/stdlib/_src/io/Eval/zip.ts b/packages/stdlib/_src/io/Eval/zip.ts index ffe9f705..ed15d73a 100644 --- a/packages/stdlib/_src/io/Eval/zip.ts +++ b/packages/stdlib/_src/io/Eval/zip.ts @@ -5,6 +5,6 @@ * @tsplus static Eval.Aspects zip * @tsplus pipeable Eval zip */ -export function zip(that: LazyArg>) { +export function zip(that: Eval) { return (self: Eval): Eval> => self.zipWith(that, (a, b) => Tuple(a, b)) } diff --git a/packages/stdlib/_src/io/Eval/zipLeft.ts b/packages/stdlib/_src/io/Eval/zipLeft.ts index 1743c6f0..124990d0 100644 --- a/packages/stdlib/_src/io/Eval/zipLeft.ts +++ b/packages/stdlib/_src/io/Eval/zipLeft.ts @@ -6,6 +6,6 @@ * @tsplus static Eval.Aspects zipLeft * @tsplus pipeable Eval zipLeft */ -export function zipLeft(that: LazyArg>) { +export function zipLeft(that: Eval) { return (self: Eval): Eval => self.zipWith(that, (a, _) => a) } diff --git a/packages/stdlib/_src/io/Eval/zipRight.ts b/packages/stdlib/_src/io/Eval/zipRight.ts index 06386cba..aa336f3c 100644 --- a/packages/stdlib/_src/io/Eval/zipRight.ts +++ b/packages/stdlib/_src/io/Eval/zipRight.ts @@ -6,6 +6,6 @@ * @tsplus static Eval.Aspects zipRight * @tsplus pipeable Eval zipRight */ -export function zipRight(that: LazyArg>) { +export function zipRight(that: Eval) { return (self: Eval): Eval => self.zipWith(that, (_, b) => b) } diff --git a/packages/stdlib/_src/io/Eval/zipWith.ts b/packages/stdlib/_src/io/Eval/zipWith.ts index a8e1dc12..64682509 100644 --- a/packages/stdlib/_src/io/Eval/zipWith.ts +++ b/packages/stdlib/_src/io/Eval/zipWith.ts @@ -5,6 +5,6 @@ * @tsplus static Eval.Aspects zipWith * @tsplus pipeable Eval zipWith */ -export function zipWith(that: LazyArg>, f: (a: A, b: B) => C) { - return (self: Eval): Eval => self.flatMap((a) => that().map((b) => f(a, b))) +export function zipWith(that: Eval, f: (a: A, b: B) => C) { + return (self: Eval): Eval => self.flatMap((a) => that.map((b) => f(a, b))) } diff --git a/packages/stdlib/_src/prelude/Associative/definition.ts b/packages/stdlib/_src/prelude/Associative/definition.ts index 94a1e2bc..d44beb05 100644 --- a/packages/stdlib/_src/prelude/Associative/definition.ts +++ b/packages/stdlib/_src/prelude/Associative/definition.ts @@ -15,4 +15,5 @@ export interface Associative extends Closure { export interface AssociativeOps { (combine: (x: A, y: A) => A): Associative } -export const Associative: AssociativeOps = (combine: (x: A, y: A) => A): Associative => HKT.instance({ combine }) +export const Associative: AssociativeOps = (combine: (x: A, y: A) => A): Associative => + HKT.instance({ combine }) diff --git a/packages/stdlib/_src/prelude/Associative/fold.ts b/packages/stdlib/_src/prelude/Associative/fold.ts index 24f37548..7686faec 100644 --- a/packages/stdlib/_src/prelude/Associative/fold.ts +++ b/packages/stdlib/_src/prelude/Associative/fold.ts @@ -4,5 +4,6 @@ * @tsplus static Associative/Ops fold */ export function fold(S: Associative) { - return (init: A) => (collection: Collection): A => collection.reduce(init, (x, y) => S.combine(x, y)) + return (init: A) => + (collection: Collection): A => collection.reduce(init, (x, y) => S.combine(x, y)) } diff --git a/packages/stdlib/_src/prelude/AssociativeFlatten.ts b/packages/stdlib/_src/prelude/AssociativeFlatten.ts index 1a822930..68e855c5 100644 --- a/packages/stdlib/_src/prelude/AssociativeFlatten.ts +++ b/packages/stdlib/_src/prelude/AssociativeFlatten.ts @@ -14,5 +14,7 @@ export interface AssociativeFlatten extends HKT.Typeclass { readonly Law: { AssociativeFlatten: "AssociativeFlatten" } - readonly flatten: (ffa: HKT.Kind>) => HKT.Kind + readonly flatten: ( + ffa: HKT.Kind> + ) => HKT.Kind } diff --git a/packages/stdlib/_src/prelude/AssociativeIdentity/fromAssociative.ts b/packages/stdlib/_src/prelude/AssociativeIdentity/fromAssociative.ts index a177c799..706c4e88 100644 --- a/packages/stdlib/_src/prelude/AssociativeIdentity/fromAssociative.ts +++ b/packages/stdlib/_src/prelude/AssociativeIdentity/fromAssociative.ts @@ -3,6 +3,9 @@ * * @tsplus static AssociativeIdentity/Ops fromAssociative */ -export function fromAssociative(identity: A, associative: Associative): AssociativeIdentity { +export function fromAssociative( + identity: A, + associative: Associative +): AssociativeIdentity { return AssociativeIdentity(identity, associative.combine) } diff --git a/packages/stdlib/_src/prelude/Closure/definition.ts b/packages/stdlib/_src/prelude/Closure/definition.ts index 0c38255c..733f3e10 100644 --- a/packages/stdlib/_src/prelude/Closure/definition.ts +++ b/packages/stdlib/_src/prelude/Closure/definition.ts @@ -12,4 +12,5 @@ export interface Closure { export interface ClosureOps { (combine: (x: A, y: A) => A): Closure } -export const Closure: ClosureOps = (combine: (x: A, y: A) => A): Closure => HKT.instance({ combine }) +export const Closure: ClosureOps = (combine: (x: A, y: A) => A): Closure => + HKT.instance({ combine }) diff --git a/packages/stdlib/_src/prelude/DSL/apF.ts b/packages/stdlib/_src/prelude/DSL/apF.ts index 2b4b386b..c89bd4ab 100644 --- a/packages/stdlib/_src/prelude/DSL/apF.ts +++ b/packages/stdlib/_src/prelude/DSL/apF.ts @@ -5,7 +5,8 @@ export function apF_(F: Apply) { return ( fab: HKT.Kind B>, fa: HKT.Kind - ): HKT.Kind => F.map(({ tuple: [a, f] }: Tuple<[A, (a: A) => B]>) => f(a))(F.both(fab)(fa)) + ): HKT.Kind => + F.map(({ tuple: [a, f] }: Tuple<[A, (a: A) => B]>) => f(a))(F.both(fab)(fa)) } /** diff --git a/packages/stdlib/_src/prelude/DSL/orElseF.ts b/packages/stdlib/_src/prelude/DSL/orElseF.ts index fad4afc8..56361661 100644 --- a/packages/stdlib/_src/prelude/DSL/orElseF.ts +++ b/packages/stdlib/_src/prelude/DSL/orElseF.ts @@ -5,7 +5,8 @@ export function orElseF_(F: Covariant & AssociativeEither) return ( fa: HKT.Kind, fb: LazyArg> - ): HKT.Kind => F.map((either: Either) => either.merge)(F.orElseEither(fb)(fa)) + ): HKT.Kind => + F.map((either: Either) => either.merge)(F.orElseEither(fb)(fa)) } /** diff --git a/packages/stdlib/_src/prelude/DSL/zip.ts b/packages/stdlib/_src/prelude/DSL/zip.ts index 8e3e62d4..25332ac8 100644 --- a/packages/stdlib/_src/prelude/DSL/zip.ts +++ b/packages/stdlib/_src/prelude/DSL/zip.ts @@ -13,5 +13,6 @@ export function zipF_(F: Apply) { */ export function zipF(F: Apply) { return (fb: HKT.Kind) => - (fa: HKT.Kind): HKT.Kind> => zipF_(F)(fa, fb) + (fa: HKT.Kind): HKT.Kind> => + zipF_(F)(fa, fb) } diff --git a/packages/stdlib/_src/prelude/FX/Provide.ts b/packages/stdlib/_src/prelude/FX/Provide.ts index 422f5d31..6e14e7d0 100644 --- a/packages/stdlib/_src/prelude/FX/Provide.ts +++ b/packages/stdlib/_src/prelude/FX/Provide.ts @@ -5,5 +5,7 @@ export interface Provide extends HKT.Typeclass { readonly Law: { readonly Provide: "Provide" } - readonly provide: (r: R) => (fa: HKT.Kind) => HKT.Kind + readonly provide: ( + r: R + ) => (fa: HKT.Kind) => HKT.Kind } diff --git a/packages/stdlib/_src/prelude/FilterMap.ts b/packages/stdlib/_src/prelude/FilterMap.ts index a11f13c9..f4a1d9cb 100644 --- a/packages/stdlib/_src/prelude/FilterMap.ts +++ b/packages/stdlib/_src/prelude/FilterMap.ts @@ -5,5 +5,7 @@ export interface FilterMap extends HKT.Typeclass { readonly Law: { readonly FilterMap: "FilterMap" } - readonly filterMap: (f: (a: A) => Maybe) => (fa: HKT.Kind) => HKT.Kind + readonly filterMap: ( + f: (a: A) => Maybe + ) => (fa: HKT.Kind) => HKT.Kind } diff --git a/packages/stdlib/_src/prelude/FilterWithIndex.ts b/packages/stdlib/_src/prelude/FilterWithIndex.ts index bca5c2d8..de13480b 100644 --- a/packages/stdlib/_src/prelude/FilterWithIndex.ts +++ b/packages/stdlib/_src/prelude/FilterWithIndex.ts @@ -9,6 +9,8 @@ export interface FilterWithIndex extends HKT.Typeclass { ( refinement: RefinementWithIndex ): (fa: HKT.Kind) => HKT.Kind - (predicate: PredicateWithIndex): (fa: HKT.Kind) => HKT.Kind + ( + predicate: PredicateWithIndex + ): (fa: HKT.Kind) => HKT.Kind } } diff --git a/packages/stdlib/_src/prelude/FoldMapWithIndex.ts b/packages/stdlib/_src/prelude/FoldMapWithIndex.ts index 9eda608b..bcd7e1ea 100644 --- a/packages/stdlib/_src/prelude/FoldMapWithIndex.ts +++ b/packages/stdlib/_src/prelude/FoldMapWithIndex.ts @@ -10,6 +10,8 @@ export interface FoldMapWithIndex extends HKT.Typeclass { export declare namespace FoldMapWithIndex { export interface Fn { - (M: AssociativeIdentity): (f: (k: K, a: A) => M) => (fa: HKT.Kind) => M + ( + M: AssociativeIdentity + ): (f: (k: K, a: A) => M) => (fa: HKT.Kind) => M } } diff --git a/packages/stdlib/_src/prelude/ForEach.ts b/packages/stdlib/_src/prelude/ForEach.ts index 47493804..b9ff0312 100644 --- a/packages/stdlib/_src/prelude/ForEach.ts +++ b/packages/stdlib/_src/prelude/ForEach.ts @@ -93,7 +93,9 @@ export function getComposition( export function sequenceF(T: ForEach) { return ( App: Covariant & IdentityBoth - ): (_: HKT.Kind>) => HKT.Kind> => { + ): ( + _: HKT.Kind> + ) => HKT.Kind> => { const traverse = T.forEachF(App) return traverse(identity) } diff --git a/packages/stdlib/_src/prelude/Ord/definition.ts b/packages/stdlib/_src/prelude/Ord/definition.ts index c83db4c7..25cd8dee 100644 --- a/packages/stdlib/_src/prelude/Ord/definition.ts +++ b/packages/stdlib/_src/prelude/Ord/definition.ts @@ -15,4 +15,5 @@ export interface Ord { export interface OrdOps { (compare: (x: A, y: A) => Ordering): Ord } -export const Ord: OrdOps = (compare: (x: A, y: A) => Ordering): Ord => HKT.instance({ compare }) +export const Ord: OrdOps = (compare: (x: A, y: A) => Ordering): Ord => + HKT.instance({ compare }) diff --git a/packages/stdlib/_src/prelude/Ord/getAssociative.ts b/packages/stdlib/_src/prelude/Ord/getAssociative.ts index 44550c14..cff3f9b7 100644 --- a/packages/stdlib/_src/prelude/Ord/getAssociative.ts +++ b/packages/stdlib/_src/prelude/Ord/getAssociative.ts @@ -5,5 +5,7 @@ * @tsplus static Ord/Ops getAssociative */ export function getAssociative(): Associative> { - return Associative((x, y) => Ord((a, b) => Ordering.Associative.combine(x.compare(a, b), y.compare(a, b)))) + return Associative((x, y) => + Ord((a, b) => Ordering.Associative.combine(x.compare(a, b), y.compare(a, b))) + ) } diff --git a/packages/stdlib/_src/prelude/Selective.ts b/packages/stdlib/_src/prelude/Selective.ts index cb648add..de3c7a24 100644 --- a/packages/stdlib/_src/prelude/Selective.ts +++ b/packages/stdlib/_src/prelude/Selective.ts @@ -107,5 +107,6 @@ export function ifF(F: Selective) { export function whenF(F: Selective) { const succeedF = DSL.succeedF(F) return (act: HKT.Kind) => - (if_: HKT.Kind): HKT.Kind => ifF(F)(act, succeedF(undefined))(if_) + (if_: HKT.Kind): HKT.Kind => + ifF(F)(act, succeedF(undefined))(if_) } diff --git a/packages/stdlib/_src/service/Env.ts b/packages/stdlib/_src/service/Env.ts index 4efc0fbc..4b1a242a 100644 --- a/packages/stdlib/_src/service/Env.ts +++ b/packages/stdlib/_src/service/Env.ts @@ -96,5 +96,8 @@ export interface Env { unsafeGet(this: Env, tag: Tag): S getMaybe(this: Env, tag: Tag): Maybe merge(this: Env, that: Env): Env - prune[]>(this: Env, ...tags: S): Env<{ [k in keyof S]: Tag.TagType }[number]> + prune[]>( + this: Env, + ...tags: S + ): Env<{ [k in keyof S]: Tag.TagType }[number]> } diff --git a/packages/stdlib/_src/service/Patch.ts b/packages/stdlib/_src/service/Patch.ts index 61f0a18e..813c8dd7 100644 --- a/packages/stdlib/_src/service/Patch.ts +++ b/packages/stdlib/_src/service/Patch.ts @@ -110,7 +110,11 @@ export function patch(env: Env) { const updatedRef = { ref: false } - const updated = patchLoop(new Map(env.unsafeMap), List(self as Patch), updatedRef) + const updated = patchLoop( + new Map(env.unsafeMap), + List(self as Patch), + updatedRef + ) if (!updatedRef.ref) { return new Env(updated) as Env } @@ -158,7 +162,11 @@ function patchLoop( return patchLoop((env.delete(head.tag), env), tail, updatedRef) } case "UpdateService": { - return patchLoop(env.set(head.tag, head.update(env.get(head.tag))), tail, (updatedRef.ref = true, updatedRef)) + return patchLoop( + env.set(head.tag, head.update(env.get(head.tag))), + tail, + (updatedRef.ref = true, updatedRef) + ) } } } @@ -186,7 +194,10 @@ export function combine(that: Patch) { /** * @tsplus static Patch.Ops diff */ -export function diff(oldValue: Env, newValue: Env): Patch { +export function diff( + oldValue: Env, + newValue: Env +): Patch { const missingServices = new Map(oldValue.unsafeMap) let patch = Patch.empty() diff --git a/packages/stdlib/_src/type-level/check.ts b/packages/stdlib/_src/type-level/check.ts index abc68043..63edb137 100644 --- a/packages/stdlib/_src/type-level/check.ts +++ b/packages/stdlib/_src/type-level/check.ts @@ -80,7 +80,10 @@ export declare namespace Check { /** * @tsplus type Check.HaveSameLength */ - type HaveSameLength = IsEqual + type HaveSameLength = IsEqual< + A["length"], + B["length"] + > /** * @tsplus type Check.IsTagged diff --git a/packages/stdlib/_src/type-level/common.ts b/packages/stdlib/_src/type-level/common.ts index bacd10ee..c719dcbe 100644 --- a/packages/stdlib/_src/type-level/common.ts +++ b/packages/stdlib/_src/type-level/common.ts @@ -2,7 +2,9 @@ export declare namespace TypeLevel { /** * @tsplus type TypeLevel.UnionToIntersection */ - type UnionToIntersection = (T extends any ? (x: T) => any : never) extends (x: infer R) => any ? R : never + type UnionToIntersection = (T extends any ? (x: T) => any : never) extends (x: infer R) => any + ? R + : never /** * @tsplus type TypeLevel.RequiredKeys diff --git a/packages/stdlib/_test/AssociativeIdentity.test.ts b/packages/stdlib/_test/AssociativeIdentity.test.ts index d3575fc4..f708aa7b 100644 --- a/packages/stdlib/_test/AssociativeIdentity.test.ts +++ b/packages/stdlib/_test/AssociativeIdentity.test.ts @@ -74,7 +74,11 @@ describe.concurrent("AssociativeIdentity", () => { it("tuple", () => { const M1 = AssociativeIdentity.tuple(AssociativeIdentity.string, AssociativeIdentity.sum) - const M2 = AssociativeIdentity.tuple(AssociativeIdentity.string, AssociativeIdentity.sum, AssociativeIdentity.all) + const M2 = AssociativeIdentity.tuple( + AssociativeIdentity.string, + AssociativeIdentity.sum, + AssociativeIdentity.all + ) assert.deepStrictEqual(M1.combine(["a", 1], ["b", 2]), ["ab", 3]) assert.deepStrictEqual(M2.combine(["a", 1, true], ["b", 2, false]), ["ab", 3, false]) diff --git a/packages/stdlib/_test/Chunk.test.ts b/packages/stdlib/_test/Chunk.test.ts index 423b27ed..4fa317d8 100644 --- a/packages/stdlib/_test/Chunk.test.ts +++ b/packages/stdlib/_test/Chunk.test.ts @@ -123,7 +123,8 @@ describe.concurrent("Chunk", () => { assert.isTrue(Chunk(1, 2, 3, 4).extend(sum) == Chunk(10, 9, 7, 4)) assert.isTrue( - Chunk(1, 2, 3, 4).extend(identity) == Chunk(Chunk(1, 2, 3, 4), Chunk(2, 3, 4), Chunk(3, 4), Chunk(4)) + Chunk(1, 2, 3, 4).extend(identity) == + Chunk(Chunk(1, 2, 3, 4), Chunk(2, 3, 4), Chunk(3, 4), Chunk(4)) ) }) @@ -278,7 +279,9 @@ describe.concurrent("Chunk", () => { }) it("intersection", () => { - assert.isTrue(Chunk(1, 2).intersection(Equivalence.number, Chunk(3, 4)) == Chunk.empty()) + assert.isTrue( + Chunk(1, 2).intersection(Equivalence.number, Chunk(3, 4)) == Chunk.empty() + ) assert.isTrue(Chunk(1, 2).intersection(Equivalence.number, Chunk(2, 3)) == Chunk(2)) assert.isTrue(Chunk(1, 2).intersection(Equivalence.number, Chunk(1, 2)) == Chunk(1, 2)) }) @@ -317,7 +320,10 @@ describe.concurrent("Chunk", () => { }) it("partition", () => { - assert.isTrue(Chunk.empty().partition((n) => n > 2) == Tuple(Chunk.empty(), Chunk.empty())) + assert.isTrue( + Chunk.empty().partition((n) => n > 2) == + Tuple(Chunk.empty(), Chunk.empty()) + ) assert.isTrue(Chunk(1, 3).partition((n) => n > 2) == Tuple(Chunk(1), Chunk(3))) }) @@ -403,7 +409,9 @@ describe.concurrent("Chunk", () => { }) it("separate", () => { - const chunk = Chunk(1, 2, 3, 4, 5, 6).map((n) => n % 2 === 0 ? Either.right(n) : Either.left(n.toString())) + const chunk = Chunk(1, 2, 3, 4, 5, 6).map((n) => + n % 2 === 0 ? Either.right(n) : Either.left(n.toString()) + ) const result = chunk.separate @@ -526,14 +534,28 @@ describe.concurrent("Chunk", () => { const chunk = Chunk(0, 1, 2, 3, 4, 5) - assert.isTrue(flattenArray(chunk.split(2)) == ImmutableArray(ImmutableArray(0, 1, 2), ImmutableArray(3, 4, 5))) + assert.isTrue( + flattenArray(chunk.split(2)) == + ImmutableArray(ImmutableArray(0, 1, 2), ImmutableArray(3, 4, 5)) + ) assert.isTrue( flattenArray(chunk.split(4)) == - ImmutableArray(ImmutableArray(0, 1), ImmutableArray(2, 3), ImmutableArray(4), ImmutableArray(5)) + ImmutableArray( + ImmutableArray(0, 1), + ImmutableArray(2, 3), + ImmutableArray(4), + ImmutableArray(5) + ) ) assert.isTrue( flattenArray(chunk.split(5)) == - ImmutableArray(ImmutableArray(0, 1), ImmutableArray(2), ImmutableArray(3), ImmutableArray(4), ImmutableArray(5)) + ImmutableArray( + ImmutableArray(0, 1), + ImmutableArray(2), + ImmutableArray(3), + ImmutableArray(4), + ImmutableArray(5) + ) ) }) @@ -587,7 +609,10 @@ describe.concurrent("Chunk", () => { assert.isTrue(Chunk(1, 2).union(Equivalence.number, Chunk(1, 2)) == Chunk(1, 2)) assert.isTrue(Chunk(1, 2).union(Equivalence.number, Chunk.empty()) == Chunk(1, 2)) assert.isTrue(Chunk.empty().union(Equivalence.number, Chunk(1, 2)) == Chunk(1, 2)) - assert.isTrue(Chunk.empty().union(Equivalence.number, Chunk.empty()) == Chunk.empty()) + assert.isTrue( + Chunk.empty().union(Equivalence.number, Chunk.empty()) == + Chunk.empty() + ) }) it("uniq", () => { @@ -619,8 +644,12 @@ describe.concurrent("Chunk", () => { assert.isTrue(Chunk(2, 1, 2).uniq(Equivalence.number) == Chunk(2, 1)) assert.isTrue(Chunk(1, 2, 1).uniq(Equivalence.number) == Chunk(1, 2)) assert.isTrue(Chunk(1, 2, 3, 4, 5).uniq(Equivalence.number) == Chunk(1, 2, 3, 4, 5)) - assert.isTrue(Chunk(1, 1, 2, 2, 3, 3, 4, 4, 5, 5).uniq(Equivalence.number) == Chunk(1, 2, 3, 4, 5)) - assert.isTrue(Chunk(1, 2, 3, 4, 5, 1, 2, 3, 4, 5).uniq(Equivalence.number) == Chunk(1, 2, 3, 4, 5)) + assert.isTrue( + Chunk(1, 1, 2, 2, 3, 3, 4, 4, 5, 5).uniq(Equivalence.number) == Chunk(1, 2, 3, 4, 5) + ) + assert.isTrue( + Chunk(1, 2, 3, 4, 5, 1, 2, 3, 4, 5).uniq(Equivalence.number) == Chunk(1, 2, 3, 4, 5) + ) assert.isTrue(Chunk("a", "b", "a").uniq(Equivalence.string) == Chunk("a", "b")) assert.isTrue(Chunk("a", "b", "A").uniq(Equivalence.string) == Chunk("a", "b", "A")) }) diff --git a/packages/stdlib/_test/Either.test.ts b/packages/stdlib/_test/Either.test.ts index 68ad65d8..a25f2f15 100644 --- a/packages/stdlib/_test/Either.test.ts +++ b/packages/stdlib/_test/Either.test.ts @@ -28,7 +28,8 @@ describe.concurrent("Either", () => { (Either.rightW(0).catchAll((s) => Either.right(s.length))) == Either.right(0) ) assert.isTrue( - (Either.leftW("hello").catchAll((s) => Either.right(s.length))) == Either.right(5) + (Either.leftW("hello").catchAll((s) => Either.right(s.length))) == + Either.right(5) ) }) @@ -47,9 +48,15 @@ describe.concurrent("Either", () => { }) it("compactOption", () => { - assert.isTrue(Either.left("hello").compactMaybe(AssociativeIdentity.string) == Either.left("hello")) - assert.isTrue(Either.right(Maybe.none).compactMaybe(AssociativeIdentity.string) == Either.left("")) - assert.isTrue(Either.right(Maybe.some(0)).compactMaybe(AssociativeIdentity.string) == Either.right(0)) + assert.isTrue( + Either.left("hello").compactMaybe(AssociativeIdentity.string) == Either.left("hello") + ) + assert.isTrue( + Either.right(Maybe.none).compactMaybe(AssociativeIdentity.string) == Either.left("") + ) + assert.isTrue( + Either.right(Maybe.some(0)).compactMaybe(AssociativeIdentity.string) == Either.right(0) + ) }) it("do", () => { @@ -212,7 +219,9 @@ describe.concurrent("Either", () => { const p = (n: number) => n > 2 const f = separateF((n: number) => Maybe.some(p(n) ? Either.right(n + 1) : Either.left(n - 1))) - assert.isTrue(f(Either.left("foo")) == Maybe.some(Tuple(Either.left("foo"), Either.left("foo")))) + assert.isTrue( + f(Either.left("foo")) == Maybe.some(Tuple(Either.left("foo"), Either.left("foo"))) + ) assert.isTrue(f(Either.right(1)) == Maybe.some(Tuple(Either.right(0), Either.left("")))) assert.isTrue(f(Either.right(3)) == Maybe.some(Tuple(Either.left(""), Either.right(4)))) }) @@ -297,7 +306,9 @@ describe.concurrent("Either", () => { }) it("stringifyJSON", () => { - assert.isTrue(Either.stringifyJSON({ foo: "bar" }, () => 0) == Either.right("{\"foo\":\"bar\"}")) + assert.isTrue( + Either.stringifyJSON({ foo: "bar" }, () => 0) == Either.right("{\"foo\":\"bar\"}") + ) }) it("struct", () => { diff --git a/packages/stdlib/_test/HashMap.test.ts b/packages/stdlib/_test/HashMap.test.ts index 8eb619dc..3715fd98 100644 --- a/packages/stdlib/_test/HashMap.test.ts +++ b/packages/stdlib/_test/HashMap.test.ts @@ -235,7 +235,10 @@ describe.concurrent("HashMap", () => { it("modify", () => { const hashMap = HashMap(Tuple(key(0), value("a")), Tuple(key(1), value("b"))) - const result = hashMap.modify(key(0), (maybe) => maybe.isSome() ? Maybe.some(value("test")) : Maybe.none) + const result = hashMap.modify( + key(0), + (maybe) => maybe.isSome() ? Maybe.some(value("test")) : Maybe.none + ) assert.isTrue(result[key(0)] == Maybe.some(value("test"))) assert.isTrue(result[key(1)] == Maybe.some(value("b"))) diff --git a/packages/stdlib/_test/ImmutableArray.test.ts b/packages/stdlib/_test/ImmutableArray.test.ts index 2a294fc6..64b3c871 100644 --- a/packages/stdlib/_test/ImmutableArray.test.ts +++ b/packages/stdlib/_test/ImmutableArray.test.ts @@ -19,13 +19,19 @@ describe.concurrent("ImmutableArray", () => { const f = (i: number, n: number) => ((i + n) % 2 === 0 ? Maybe.none : Maybe.some(n)) assert.isTrue(ImmutableArray(1, 2, 4).collectWithIndex(f) == ImmutableArray(1, 2)) - assert.isTrue(ImmutableArray.empty().collectWithIndex(f) == ImmutableArray.empty()) + assert.isTrue( + ImmutableArray.empty().collectWithIndex(f) == ImmutableArray.empty() + ) }) it("compact", () => { assert.isTrue(ImmutableArray.empty>().compact == ImmutableArray.empty()) - assert.isTrue(ImmutableArray(Maybe.some(1), Maybe.some(2), Maybe.some(3)).compact == ImmutableArray(1, 2, 3)) - assert.isTrue(ImmutableArray(Maybe.some(1), Maybe.none, Maybe.some(3)).compact == ImmutableArray(1, 3)) + assert.isTrue( + ImmutableArray(Maybe.some(1), Maybe.some(2), Maybe.some(3)).compact == ImmutableArray(1, 2, 3) + ) + assert.isTrue( + ImmutableArray(Maybe.some(1), Maybe.none, Maybe.some(3)).compact == ImmutableArray(1, 3) + ) }) it("compactF", () => { @@ -60,9 +66,17 @@ describe.concurrent("ImmutableArray", () => { }) it("difference", () => { - assert.isTrue(ImmutableArray(1, 2).difference(Equivalence.number, ImmutableArray(3, 4)) == ImmutableArray(1, 2)) - assert.isTrue(ImmutableArray(1, 2).difference(Equivalence.number, ImmutableArray(2, 3)) == ImmutableArray(1)) - assert.isTrue(ImmutableArray(1, 2).difference(Equivalence.number, ImmutableArray(1, 2)) == ImmutableArray.empty()) + assert.isTrue( + ImmutableArray(1, 2).difference(Equivalence.number, ImmutableArray(3, 4)) == + ImmutableArray(1, 2) + ) + assert.isTrue( + ImmutableArray(1, 2).difference(Equivalence.number, ImmutableArray(2, 3)) == ImmutableArray(1) + ) + assert.isTrue( + ImmutableArray(1, 2).difference(Equivalence.number, ImmutableArray(1, 2)) == + ImmutableArray.empty() + ) }) it("elem", () => { @@ -82,12 +96,19 @@ describe.concurrent("ImmutableArray", () => { }) it("extend", () => { - const sum: (self: ImmutableArray) => number = AssociativeIdentity.fold(AssociativeIdentity.sum) + const sum: (self: ImmutableArray) => number = AssociativeIdentity.fold( + AssociativeIdentity.sum + ) assert.isTrue(ImmutableArray(1, 2, 3, 4).extend(sum) == ImmutableArray(10, 9, 7, 4)) assert.isTrue( ImmutableArray(1, 2, 3, 4).extend(identity) == - ImmutableArray(ImmutableArray(1, 2, 3, 4), ImmutableArray(2, 3, 4), ImmutableArray(3, 4), ImmutableArray(4)) + ImmutableArray( + ImmutableArray(1, 2, 3, 4), + ImmutableArray(2, 3, 4), + ImmutableArray(3, 4), + ImmutableArray(4) + ) ) }) @@ -175,7 +196,9 @@ describe.concurrent("ImmutableArray", () => { it("getAssociativeIdentity", () => { const M = ImmutableArray.getAssociativeIdentity() - assert.isTrue(M.combine(ImmutableArray(1, 2), ImmutableArray(3, 4)) == ImmutableArray(1, 2, 3, 4)) + assert.isTrue( + M.combine(ImmutableArray(1, 2), ImmutableArray(3, 4)) == ImmutableArray(1, 2, 3, 4) + ) assert.isTrue(M.combine(ImmutableArray(1, 2), M.identity) == ImmutableArray(1, 2)) assert.isTrue(M.combine(M.identity, ImmutableArray(1, 2)) == ImmutableArray(1, 2)) }) @@ -228,10 +251,17 @@ describe.concurrent("ImmutableArray", () => { it("intersection", () => { assert.isTrue( - ImmutableArray(1, 2).intersection(Equivalence.number, ImmutableArray(3, 4)) == ImmutableArray.empty() + ImmutableArray(1, 2).intersection(Equivalence.number, ImmutableArray(3, 4)) == + ImmutableArray.empty() + ) + assert.isTrue( + ImmutableArray(1, 2).intersection(Equivalence.number, ImmutableArray(2, 3)) == + ImmutableArray(2) + ) + assert.isTrue( + ImmutableArray(1, 2).intersection(Equivalence.number, ImmutableArray(1, 2)) == + ImmutableArray(1, 2) ) - assert.isTrue(ImmutableArray(1, 2).intersection(Equivalence.number, ImmutableArray(2, 3)) == ImmutableArray(2)) - assert.isTrue(ImmutableArray(1, 2).intersection(Equivalence.number, ImmutableArray(1, 2)) == ImmutableArray(1, 2)) }) it("isEmpty", () => { @@ -250,9 +280,12 @@ describe.concurrent("ImmutableArray", () => { it("partition", () => { assert.isTrue( - ImmutableArray.empty().partition((n) => n > 2) == Tuple(ImmutableArray.empty(), ImmutableArray.empty()) + ImmutableArray.empty().partition((n) => n > 2) == + Tuple(ImmutableArray.empty(), ImmutableArray.empty()) + ) + assert.isTrue( + ImmutableArray(1, 3).partition((n) => n > 2) == Tuple(ImmutableArray(1), ImmutableArray(3)) ) - assert.isTrue(ImmutableArray(1, 3).partition((n) => n > 2) == Tuple(ImmutableArray(1), ImmutableArray(3))) }) it("partitionMap", () => { @@ -272,9 +305,11 @@ describe.concurrent("ImmutableArray", () => { Tuple(ImmutableArray.empty(), ImmutableArray.empty()) ) assert.isTrue( - ImmutableArray(Either.right(1), Either.left("foo"), Either.right(2)).partitionMapWithIndex((i, a) => - a.filterOrElse((n) => n > i, () => "error") - ) == Tuple(ImmutableArray("foo", "error"), ImmutableArray(1)) + ImmutableArray(Either.right(1), Either.left("foo"), Either.right(2)).partitionMapWithIndex(( + i, + a + ) => a.filterOrElse((n) => n > i, () => "error")) == + Tuple(ImmutableArray("foo", "error"), ImmutableArray(1)) ) }) @@ -284,7 +319,8 @@ describe.concurrent("ImmutableArray", () => { Tuple(ImmutableArray.empty(), ImmutableArray.empty()) ) assert.isTrue( - ImmutableArray(1, 2).partitionWithIndex((i, n) => i + n > 2) == Tuple(ImmutableArray(1), ImmutableArray(2)) + ImmutableArray(1, 2).partitionWithIndex((i, n) => i + n > 2) == + Tuple(ImmutableArray(1), ImmutableArray(2)) ) }) @@ -295,7 +331,9 @@ describe.concurrent("ImmutableArray", () => { it("sequence", () => { const sequence = ImmutableArray.sequence(Maybe.Applicative) - assert.isTrue(sequence(ImmutableArray(Maybe.some(1), Maybe.some(3))) == Maybe.some(ImmutableArray(1, 3))) + assert.isTrue( + sequence(ImmutableArray(Maybe.some(1), Maybe.some(3))) == Maybe.some(ImmutableArray(1, 3)) + ) assert.isTrue(sequence(ImmutableArray(Maybe.some(1), Maybe.none)) == Maybe.none) }) @@ -378,21 +416,28 @@ describe.concurrent("ImmutableArray", () => { ) assert.isTrue( - separateF(ImmutableArray.empty()) == Maybe.some(Tuple(ImmutableArray.empty(), ImmutableArray.empty())) + separateF(ImmutableArray.empty()) == + Maybe.some(Tuple(ImmutableArray.empty(), ImmutableArray.empty())) + ) + assert.isTrue( + separateF(ImmutableArray(1, 3)) == Maybe.some(Tuple(ImmutableArray(0), ImmutableArray(4))) ) - assert.isTrue(separateF(ImmutableArray(1, 3)) == Maybe.some(Tuple(ImmutableArray(0), ImmutableArray(4)))) }) it("separateWithIndexF", () => { - const separateWithIndexF = ImmutableArray.separateWithIndexF(Maybe.Applicative)((i, n: number) => - Maybe.some(n > 2 ? Either.right(n + i) : Either.left(n - i)) - ) + const separateWithIndexF = ImmutableArray.separateWithIndexF(Maybe.Applicative)(( + i, + n: number + ) => Maybe.some(n > 2 ? Either.right(n + i) : Either.left(n - i))) assert.isTrue( separateWithIndexF(ImmutableArray.empty()) == Maybe.some(Tuple(ImmutableArray.empty(), ImmutableArray.empty())) ) - assert.isTrue(separateWithIndexF(ImmutableArray(1, 3)) == Maybe.some(Tuple(ImmutableArray(1), ImmutableArray(4)))) + assert.isTrue( + separateWithIndexF(ImmutableArray(1, 3)) == + Maybe.some(Tuple(ImmutableArray(1), ImmutableArray(4))) + ) }) it("size", () => { @@ -464,9 +509,12 @@ describe.concurrent("ImmutableArray", () => { assert.isTrue(two.union(Equivalence.number, ImmutableArray(2, 3)) == ImmutableArray(1, 2, 3)) assert.isTrue(two.union(Equivalence.number, ImmutableArray(1, 2)) == ImmutableArray(1, 2)) assert.isTrue(two.union(Equivalence.number, ImmutableArray.empty()) == ImmutableArray(1, 2)) - assert.isTrue(ImmutableArray.empty().union(Equivalence.number, two) == ImmutableArray(1, 2)) assert.isTrue( - ImmutableArray.empty().union(Equivalence.number, ImmutableArray.empty()) == ImmutableArray.empty() + ImmutableArray.empty().union(Equivalence.number, two) == ImmutableArray(1, 2) + ) + assert.isTrue( + ImmutableArray.empty().union(Equivalence.number, ImmutableArray.empty()) == + ImmutableArray.empty() ) }) @@ -486,11 +534,14 @@ describe.concurrent("ImmutableArray", () => { assert.isTrue(arrUniq.uniq(E) == arrUniq) assert.isTrue(ImmutableArray(arrA, arrB, arrC, arrD).uniq(E) == ImmutableArray(arrA, arrC)) assert.isTrue(ImmutableArray(arrB, arrA, arrC, arrD).uniq(E) == ImmutableArray(arrB, arrC)) - assert.isTrue(ImmutableArray(arrA, arrA, arrC, arrD, arrA).uniq(E) == ImmutableArray(arrA, arrC)) + assert.isTrue( + ImmutableArray(arrA, arrA, arrC, arrD, arrA).uniq(E) == ImmutableArray(arrA, arrC) + ) assert.isTrue(ImmutableArray(arrA, arrC).uniq(E) == ImmutableArray(arrA, arrC)) assert.isTrue(ImmutableArray(arrC, arrA).uniq(E) == ImmutableArray(arrC, arrA)) assert.isTrue( - ImmutableArray(true, false, true, false).uniq(Equivalence.boolean) == ImmutableArray(true, false) + ImmutableArray(true, false, true, false).uniq(Equivalence.boolean) == + ImmutableArray(true, false) ) assert.isTrue(ImmutableArray.empty().uniq(Equivalence.number) == ImmutableArray.empty()) assert.isTrue(ImmutableArray(-0, -0).uniq(Equivalence.number) == ImmutableArray(-0)) @@ -498,19 +549,29 @@ describe.concurrent("ImmutableArray", () => { assert.isTrue(ImmutableArray(1).uniq(Equivalence.number) == ImmutableArray(1)) assert.isTrue(ImmutableArray(2, 1, 2).uniq(Equivalence.number) == ImmutableArray(2, 1)) assert.isTrue(ImmutableArray(1, 2, 1).uniq(Equivalence.number) == ImmutableArray(1, 2)) - assert.isTrue(ImmutableArray(1, 2, 3, 4, 5).uniq(Equivalence.number) == ImmutableArray(1, 2, 3, 4, 5)) assert.isTrue( - ImmutableArray(1, 1, 2, 2, 3, 3, 4, 4, 5, 5).uniq(Equivalence.number) == ImmutableArray(1, 2, 3, 4, 5) + ImmutableArray(1, 2, 3, 4, 5).uniq(Equivalence.number) == ImmutableArray(1, 2, 3, 4, 5) + ) + assert.isTrue( + ImmutableArray(1, 1, 2, 2, 3, 3, 4, 4, 5, 5).uniq(Equivalence.number) == + ImmutableArray(1, 2, 3, 4, 5) + ) + assert.isTrue( + ImmutableArray(1, 2, 3, 4, 5, 1, 2, 3, 4, 5).uniq(Equivalence.number) == + ImmutableArray(1, 2, 3, 4, 5) + ) + assert.isTrue( + ImmutableArray("a", "b", "a").uniq(Equivalence.string) == ImmutableArray("a", "b") ) assert.isTrue( - ImmutableArray(1, 2, 3, 4, 5, 1, 2, 3, 4, 5).uniq(Equivalence.number) == ImmutableArray(1, 2, 3, 4, 5) + ImmutableArray("a", "b", "A").uniq(Equivalence.string) == ImmutableArray("a", "b", "A") ) - assert.isTrue(ImmutableArray("a", "b", "a").uniq(Equivalence.string) == ImmutableArray("a", "b")) - assert.isTrue(ImmutableArray("a", "b", "A").uniq(Equivalence.string) == ImmutableArray("a", "b", "A")) }) it("zip", () => { - assert.isTrue(ImmutableArray.empty().zip(ImmutableArray(1, 2, 3)) == ImmutableArray.empty()) + assert.isTrue( + ImmutableArray.empty().zip(ImmutableArray(1, 2, 3)) == ImmutableArray.empty() + ) assert.isTrue( ImmutableArray(1, 2, 3).zip(ImmutableArray("a", "b", "c")) == ImmutableArray(Tuple(1, "a"), Tuple(2, "b"), Tuple(3, "c")) diff --git a/packages/stdlib/_test/ImmutableMap.test.ts b/packages/stdlib/_test/ImmutableMap.test.ts index cc913c19..4b6b4881 100644 --- a/packages/stdlib/_test/ImmutableMap.test.ts +++ b/packages/stdlib/_test/ImmutableMap.test.ts @@ -40,7 +40,9 @@ describe.concurrent("ImmutableMap", () => { it("filterMap", () => { const map = ImmutableMap(Tuple(1, "a"), Tuple(2, "b"), Tuple(3, "c")) - const result = map.filterMap((char) => char === "b" ? Maybe.some(char.toUpperCase()) : Maybe.none) + const result = map.filterMap((char) => + char === "b" ? Maybe.some(char.toUpperCase()) : Maybe.none + ) assert.isTrue(result == ImmutableMap(Tuple(2, "B"))) }) @@ -124,10 +126,18 @@ describe.concurrent("ImmutableMap", () => { it("update", () => { const map = ImmutableMap(Tuple(1, "a"), Tuple(2, "b"), Tuple(3, "c")) - const result1 = map.update(1, Maybe.$.fold(Maybe.some("-"), (char) => Maybe.some(char.toUpperCase()))) - const result2 = map.update(4, Maybe.$.fold(Maybe.some("-"), (char) => Maybe.some(char.toUpperCase()))) + const result1 = map.update( + 1, + Maybe.$.fold(Maybe.some("-"), (char) => Maybe.some(char.toUpperCase())) + ) + const result2 = map.update( + 4, + Maybe.$.fold(Maybe.some("-"), (char) => Maybe.some(char.toUpperCase())) + ) assert.isTrue(result1 == ImmutableMap(Tuple(2, "b"), Tuple(3, "c"))) - assert.isTrue(result2 == ImmutableMap(Tuple(1, "a"), Tuple(2, "b"), Tuple(3, "c"), Tuple(4, "-"))) + assert.isTrue( + result2 == ImmutableMap(Tuple(1, "a"), Tuple(2, "b"), Tuple(3, "c"), Tuple(4, "-")) + ) }) }) diff --git a/packages/stdlib/_test/List.test.ts b/packages/stdlib/_test/List.test.ts index 2135fbf6..3fe70c7c 100644 --- a/packages/stdlib/_test/List.test.ts +++ b/packages/stdlib/_test/List.test.ts @@ -66,7 +66,10 @@ describe.concurrent("List", () => { assert.isTrue(List(0, 1).toCollection == List(0, 1)) }) it("partition", () => { - assert.isTrue(List.empty().partition((n) => n > 2) == Tuple(List.empty(), List.empty())) + assert.isTrue( + List.empty().partition((n) => n > 2) == + Tuple(List.empty(), List.empty()) + ) assert.isTrue(List(1, 3).partition((n) => n > 2) == Tuple(List(1), List(3))) }) diff --git a/packages/stdlib/_test/Maybe.test.ts b/packages/stdlib/_test/Maybe.test.ts index b8d4f163..4374ce40 100644 --- a/packages/stdlib/_test/Maybe.test.ts +++ b/packages/stdlib/_test/Maybe.test.ts @@ -93,7 +93,9 @@ describe.concurrent("Maybe", () => { it("forEachF", () => { const p = (n: number) => n > 2 - const forEachF = Maybe.forEachF(Either.Applicative)((n: number) => p(n) ? Either.right(n + 1) : Either.left(n - 1)) + const forEachF = Maybe.forEachF(Either.Applicative)((n: number) => + p(n) ? Either.right(n + 1) : Either.left(n - 1) + ) assert.isTrue(forEachF(Maybe.some(1)) == Either.left(0)) assert.isTrue(forEachF(Maybe.some(3)) == Either.right(Maybe.some(4))) @@ -170,7 +172,9 @@ describe.concurrent("Maybe", () => { }) it("getRefinement", () => { - const f = (s: string | number): Maybe => (typeof s === "string" ? Maybe.some(s) : Maybe.none) + const f = ( + s: string | number + ): Maybe => (typeof s === "string" ? Maybe.some(s) : Maybe.none) const isString = Maybe.getRefinement(f) assert.isTrue(isString("s")) diff --git a/packages/stdlib/_test/ParSeq.test.ts b/packages/stdlib/_test/ParSeq.test.ts index 2ff59e24..67e7ea7d 100644 --- a/packages/stdlib/_test/ParSeq.test.ts +++ b/packages/stdlib/_test/ParSeq.test.ts @@ -57,24 +57,37 @@ describe.concurrent("ParSeq", () => { it("equals", () => { assert.isTrue(ParSeq.empty() == ParSeq.empty()) assert.isTrue( - ParSeq.combineSeq(ParSeq.empty(), ParSeq.combineSeq(ParSeq.empty(), ParSeq.empty())) == ParSeq.empty() + ParSeq.combineSeq(ParSeq.empty(), ParSeq.combineSeq(ParSeq.empty(), ParSeq.empty())) == + ParSeq.empty() ) assert.isTrue( - ParSeq.combineSeq(ParSeq.empty(), ParSeq.combinePar(ParSeq.empty(), ParSeq.empty())) == ParSeq.empty() + ParSeq.combineSeq(ParSeq.empty(), ParSeq.combinePar(ParSeq.empty(), ParSeq.empty())) == + ParSeq.empty() ) assert.isTrue( - ParSeq.combineSeq(ParSeq.single("ok"), ParSeq.combinePar(ParSeq.empty(), ParSeq.empty())) == ParSeq.single("ok") + ParSeq.combineSeq(ParSeq.single("ok"), ParSeq.combinePar(ParSeq.empty(), ParSeq.empty())) == + ParSeq.single("ok") ) assert.isTrue( - ParSeq.combineSeq(ParSeq.single("ok"), ParSeq.combinePar(ParSeq.empty(), ParSeq.empty())) == ParSeq.single("ok") + ParSeq.combineSeq(ParSeq.single("ok"), ParSeq.combinePar(ParSeq.empty(), ParSeq.empty())) == + ParSeq.single("ok") ) assert.isTrue( - ParSeq.combineSeq(ParSeq.single("ok"), ParSeq.combinePar(ParSeq.empty(), ParSeq.single("ok"))) == + ParSeq.combineSeq( + ParSeq.single("ok"), + ParSeq.combinePar(ParSeq.empty(), ParSeq.single("ok")) + ) == ParSeq.combineSeq(ParSeq.single("ok"), ParSeq.single("ok")) ) assert.isTrue( - ParSeq.combineSeq(ParSeq.single("ok"), ParSeq.combinePar(ParSeq.single("ok"), ParSeq.single("ok"))) == - ParSeq.combineSeq(ParSeq.single("ok"), ParSeq.combinePar(ParSeq.single("ok"), ParSeq.single("ok"))) + ParSeq.combineSeq( + ParSeq.single("ok"), + ParSeq.combinePar(ParSeq.single("ok"), ParSeq.single("ok")) + ) == + ParSeq.combineSeq( + ParSeq.single("ok"), + ParSeq.combinePar(ParSeq.single("ok"), ParSeq.single("ok")) + ) ) }) }) diff --git a/packages/stdlib/_test/RedBlackTree.test.ts b/packages/stdlib/_test/RedBlackTree.test.ts index 27bd35ae..98186e1a 100644 --- a/packages/stdlib/_test/RedBlackTree.test.ts +++ b/packages/stdlib/_test/RedBlackTree.test.ts @@ -165,7 +165,11 @@ describe.concurrent("RedBlackTree", () => { .insert(3, "e") assert.deepEqual(Array.from(tree.ge(0)), [Tuple(0, "b"), Tuple(1, "a"), Tuple(3, "e")]) - assert.deepEqual(Array.from(tree.ge(0, "Backward")), [Tuple(0, "b"), Tuple(-1, "c"), Tuple(-2, "d")]) + assert.deepEqual(Array.from(tree.ge(0, "Backward")), [ + Tuple(0, "b"), + Tuple(-1, "c"), + Tuple(-2, "d") + ]) }) it("find", () => { @@ -203,7 +207,21 @@ describe.concurrent("RedBlackTree", () => { assert.deepEqual(Array.from(tree.values()), ["g", "f", "e", "b", "a", "c", "d"]) assert.isTrue(tree.find(new Key(1, "0")) == ImmutableArray("f", "e", "a")) - assert.deepEqual(Array.from(tree.removeFirst(new Key(1, "1")).values()), ["f", "e", "b", "a", "c", "d"]) - assert.deepEqual(Array.from(tree.removeFirst(new Key(1, "0")).values()), ["g", "f", "e", "b", "c", "d"]) + assert.deepEqual(Array.from(tree.removeFirst(new Key(1, "1")).values()), [ + "f", + "e", + "b", + "a", + "c", + "d" + ]) + assert.deepEqual(Array.from(tree.removeFirst(new Key(1, "0")).values()), [ + "g", + "f", + "e", + "b", + "c", + "d" + ]) }) }) diff --git a/packages/stdlib/_test/Show.test.ts b/packages/stdlib/_test/Show.test.ts index cfd83609..bba5b6bf 100644 --- a/packages/stdlib/_test/Show.test.ts +++ b/packages/stdlib/_test/Show.test.ts @@ -22,7 +22,10 @@ describe.concurrent("Show", () => { it("struct", () => { assert.strictEqual(Show.struct({ a: Show.string }).show({ a: "a" }), "{ a: \"a\" }") - assert.strictEqual(Show.struct({ a: Show.string, b: Show.number }).show({ a: "a", b: 1 }), "{ a: \"a\", b: 1 }") + assert.strictEqual( + Show.struct({ a: Show.string, b: Show.number }).show({ a: "a", b: 1 }), + "{ a: \"a\", b: 1 }" + ) // Should ignore non own properties const shows = Object.create({ a: 1 }) const s = Show.struct(shows) diff --git a/packages/stdlib/_test/Tree.test.ts b/packages/stdlib/_test/Tree.test.ts index cc095d58..887e7ae3 100644 --- a/packages/stdlib/_test/Tree.test.ts +++ b/packages/stdlib/_test/Tree.test.ts @@ -104,7 +104,8 @@ describe.concurrent("Tree", () => { it("extend", () => { const t = Tree(1, Chunk(Tree(2), Tree(3))) - const f = (wa: Tree): number => wa.fold((a, bs) => bs.reduce(a, Associative.sum.combine)) + const f = (wa: Tree): number => + wa.fold((a, bs) => bs.reduce(a, Associative.sum.combine)) const expected = Tree(6, Chunk(Tree(2), Tree(3))) assert.isTrue(t.extend(f) == expected) diff --git a/yarn.lock b/yarn.lock index 8ce2f3b6..a94202ae 100644 --- a/yarn.lock +++ b/yarn.lock @@ -896,9 +896,9 @@ __metadata: languageName: node linkType: hard -"@tsplus/installer@npm:0.0.132": - version: 0.0.132 - resolution: "@tsplus/installer@npm:0.0.132" +"@tsplus/installer@npm:0.0.133": + version: 0.0.133 + resolution: "@tsplus/installer@npm:0.0.133" dependencies: mkdirp: ^1.0.4 rimraf: ^3.0.2 @@ -907,7 +907,7 @@ __metadata: zlib: ^1.0.5 bin: tsplus-install: bin/tsplus-install - checksum: 3152e70e6d8d1709c61913c0dcb4adc92337d9e3b3deb13faf4a501a9308078dfd96fe1e916e3d3c872210b685f3714a34d326780e192d0efbbb17a41c2aa913 + checksum: 1d189c101fe8f821912d085a17ccfe861e154b56e6d78a631da9e60c5aa689d75f55f5ba70e5dbae556436709db9f48458efdd3e125a74c5ba0a7281ff3288e8 languageName: node linkType: hard @@ -934,10 +934,10 @@ __metadata: languageName: node linkType: hard -"@types/chai@npm:*, @types/chai@npm:^4.3.1": - version: 4.3.1 - resolution: "@types/chai@npm:4.3.1" - checksum: 2ee246b76c469cd620a7a1876a73bc597074361b67d547b4bd96a0c1adb43597ede2d8589ab626192e14349d83cbb646cc11e2c179eeeb43ff11596de94d82c4 +"@types/chai@npm:*, @types/chai@npm:^4.3.3": + version: 4.3.3 + resolution: "@types/chai@npm:4.3.3" + checksum: 20cd094753e137cfc35939cae7f0ed78ecda7861e5c94704efab6979b9121a63807e9b631bdcf3a2792d6c6dba44050b13387262f9e63ebb040741c01c345f0a languageName: node linkType: hard @@ -1013,10 +1013,10 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:*, @types/node@npm:^18.6.4": - version: 18.6.4 - resolution: "@types/node@npm:18.6.4" - checksum: fc453dd2b541f5812ba1a8f957f577727cf2d8aee886f1d5c03eb153b2b3373d2e0953c5bd2b7a5b184073bc317f54ec91f1ec4830a58eda4a833e90654021de +"@types/node@npm:*, @types/node@npm:^18.6.5": + version: 18.6.5 + resolution: "@types/node@npm:18.6.5" + checksum: e3e66c9a84b94010a57c1b9dac882c08484278d74f9d120dbe6a3e45d00740d178bd1d34a5deee28197c94b9f4359153b637bab9b305328e865027e9987a0f3d languageName: node linkType: hard @@ -1074,13 +1074,13 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:^5.32.0": - version: 5.32.0 - resolution: "@typescript-eslint/eslint-plugin@npm:5.32.0" +"@typescript-eslint/eslint-plugin@npm:^5.33.0": + version: 5.33.0 + resolution: "@typescript-eslint/eslint-plugin@npm:5.33.0" dependencies: - "@typescript-eslint/scope-manager": 5.32.0 - "@typescript-eslint/type-utils": 5.32.0 - "@typescript-eslint/utils": 5.32.0 + "@typescript-eslint/scope-manager": 5.33.0 + "@typescript-eslint/type-utils": 5.33.0 + "@typescript-eslint/utils": 5.33.0 debug: ^4.3.4 functional-red-black-tree: ^1.0.1 ignore: ^5.2.0 @@ -1093,42 +1093,42 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 9785c34d9742b51130237bfe244924ca6dfd529bdcc5932a5cf81558f0235099c963a11125df393037db51ce451f7ab9442aba3c3a8bb2e0607569a0e31480c8 + checksum: d408f3f474b34fefde8ee65d98deb126949fd7d8e211a7f95c5cc2b507dedbf8eb239f3895e0c37aa6338989531e37c5f35c2e0de36a126c52f0846e89605487 languageName: node linkType: hard -"@typescript-eslint/parser@npm:^5.32.0": - version: 5.32.0 - resolution: "@typescript-eslint/parser@npm:5.32.0" +"@typescript-eslint/parser@npm:^5.33.0": + version: 5.33.0 + resolution: "@typescript-eslint/parser@npm:5.33.0" dependencies: - "@typescript-eslint/scope-manager": 5.32.0 - "@typescript-eslint/types": 5.32.0 - "@typescript-eslint/typescript-estree": 5.32.0 + "@typescript-eslint/scope-manager": 5.33.0 + "@typescript-eslint/types": 5.33.0 + "@typescript-eslint/typescript-estree": 5.33.0 debug: ^4.3.4 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 peerDependenciesMeta: typescript: optional: true - checksum: 3fcfa183cad125c3198fd63701c6e13dad1cc984d309e8cd40ec9a2eb857902abfd7e9ee3f030b18eb1c18c795a61ea289ef147a7f9dfac38df905e7514316af + checksum: 2617aba987a70ee6b16ecc6afa6d245422df33a9d056018ff2e316159e667a0ab9d9c15fcea95e0ba65832661e71cc2753a221e77f0b0fab278e52c4497b8278 languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:5.32.0": - version: 5.32.0 - resolution: "@typescript-eslint/scope-manager@npm:5.32.0" +"@typescript-eslint/scope-manager@npm:5.33.0": + version: 5.33.0 + resolution: "@typescript-eslint/scope-manager@npm:5.33.0" dependencies: - "@typescript-eslint/types": 5.32.0 - "@typescript-eslint/visitor-keys": 5.32.0 - checksum: 69bdeb029f39d1112299dc0cb0ddef30e51bdb782fdb79cc4e72fa448e00d71e39938d3bff3fa4ee43b3416c2e3b4564de2c37252914772b07eeedafb14412d6 + "@typescript-eslint/types": 5.33.0 + "@typescript-eslint/visitor-keys": 5.33.0 + checksum: b2cbea9abd528d01a5acb2d68a2a5be51ec6827760d3869bdd70920cf6c3a4f9f96d87c77177f8313009d9db71253e4a75f8393f38651e2abaf91ef28e60fb9d languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:5.32.0": - version: 5.32.0 - resolution: "@typescript-eslint/type-utils@npm:5.32.0" +"@typescript-eslint/type-utils@npm:5.33.0": + version: 5.33.0 + resolution: "@typescript-eslint/type-utils@npm:5.33.0" dependencies: - "@typescript-eslint/utils": 5.32.0 + "@typescript-eslint/utils": 5.33.0 debug: ^4.3.4 tsutils: ^3.21.0 peerDependencies: @@ -1136,7 +1136,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 4063808ca054789bebc6adb376d15c13e38f8ea14fa2842c38ae616d77fb77681b67a04b77887cf9ceb6f801ab3fc5eddfb6325779ab821404c62f36c56310bb + checksum: a1d1ffb42fe96bfc2339cc2875e218aa82fa9391be04c1a266bb11da1eca6835555687e81cde75477c60e6702049cd4dde7d2638e7e9b9d8cf4b7b2242353a6e languageName: node linkType: hard @@ -1147,19 +1147,19 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/types@npm:5.32.0": - version: 5.32.0 - resolution: "@typescript-eslint/types@npm:5.32.0" - checksum: 6758f54d8d7763893cd7c1753f525ef1777eee8b558bf3d54fd2a2ce691ca0cf813c68a26e4db83a1deae4e4a62b247f1195e15a1f3577f1293849f9e55a232c +"@typescript-eslint/types@npm:5.33.0": + version: 5.33.0 + resolution: "@typescript-eslint/types@npm:5.33.0" + checksum: 8bbddda84cb3adf5c659b0d42547a2d6ab87f4eea574aca5dd63a3bd85169f32796ecbddad3b27f18a609070f6b1d18a54018d488bad746ae0f6ea5c02206109 languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:5.32.0": - version: 5.32.0 - resolution: "@typescript-eslint/typescript-estree@npm:5.32.0" +"@typescript-eslint/typescript-estree@npm:5.33.0": + version: 5.33.0 + resolution: "@typescript-eslint/typescript-estree@npm:5.33.0" dependencies: - "@typescript-eslint/types": 5.32.0 - "@typescript-eslint/visitor-keys": 5.32.0 + "@typescript-eslint/types": 5.33.0 + "@typescript-eslint/visitor-keys": 5.33.0 debug: ^4.3.4 globby: ^11.1.0 is-glob: ^4.0.3 @@ -1168,7 +1168,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 6aee08be5d36603d038fb8340f324f5cb38519150c9b37c012f0c1ff2a4d8cf22fbc6835de31d069949c2b3d8ed3e729076a724ef29db4289d9fe73b97c9d310 + checksum: 26f9005cdfb14654125a33d90d872b926820e560dff8970c4629fd5f6f47ad2a31e4c63161564d21bb42a8fc3ced0033994854ee37336ae07d90ccf6300d702b languageName: node linkType: hard @@ -1190,19 +1190,19 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/utils@npm:5.32.0, @typescript-eslint/utils@npm:^5.0.0": - version: 5.32.0 - resolution: "@typescript-eslint/utils@npm:5.32.0" +"@typescript-eslint/utils@npm:5.33.0, @typescript-eslint/utils@npm:^5.0.0": + version: 5.33.0 + resolution: "@typescript-eslint/utils@npm:5.33.0" dependencies: "@types/json-schema": ^7.0.9 - "@typescript-eslint/scope-manager": 5.32.0 - "@typescript-eslint/types": 5.32.0 - "@typescript-eslint/typescript-estree": 5.32.0 + "@typescript-eslint/scope-manager": 5.33.0 + "@typescript-eslint/types": 5.33.0 + "@typescript-eslint/typescript-estree": 5.33.0 eslint-scope: ^5.1.1 eslint-utils: ^3.0.0 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - checksum: cfd88d93508c8fb0db17d2726691e1383db390357fa0637bd8111558fbe72da5130d995294001d71b1d929d620fbce3f20a70b277a77ca21a4241b3b470dc758 + checksum: 6ce5ee5eabeb6d73538b24e6487f811ecb0ef3467bd366cbd15bf30d904bdedb73fc6f48cf2e2e742dda462b42999ea505e8b59255545825ec9db86f3d423ea7 languageName: node linkType: hard @@ -1216,13 +1216,13 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:5.32.0": - version: 5.32.0 - resolution: "@typescript-eslint/visitor-keys@npm:5.32.0" +"@typescript-eslint/visitor-keys@npm:5.33.0": + version: 5.33.0 + resolution: "@typescript-eslint/visitor-keys@npm:5.33.0" dependencies: - "@typescript-eslint/types": 5.32.0 + "@typescript-eslint/types": 5.33.0 eslint-visitor-keys: ^3.3.0 - checksum: 1f9b756d648c2346a6e8538ffde729d3d9ce6621fded3d9f15c96aa0ebf8f511daf8232470423fb36359c2113538a4daaf3336181be78a0cfbfd297af91ce9ba + checksum: d7e3653de6bac6841e6fcc54226b93ad6bdca4aa76ebe7d83459c016c3eebcc50d4f65ee713174bc267d765295b642d1927a778c5de707b8389e3fcc052aa4a1 languageName: node linkType: hard @@ -6077,14 +6077,14 @@ __metadata: languageName: node linkType: hard -"postcss@npm:^8.1.7, postcss@npm:^8.4.14, postcss@npm:^8.4.6": - version: 8.4.14 - resolution: "postcss@npm:8.4.14" +"postcss@npm:^8.1.7, postcss@npm:^8.4.16, postcss@npm:^8.4.6": + version: 8.4.16 + resolution: "postcss@npm:8.4.16" dependencies: nanoid: ^3.3.4 picocolors: ^1.0.0 source-map-js: ^1.0.2 - checksum: fe58766ff32e4becf65a7d57678995cfd239df6deed2fe0557f038b47c94e4132e7e5f68b5aa820c13adfec32e523b693efaeb65798efb995ce49ccd83953816 + checksum: 10eee25efd77868036403858577da0cefaf2e0905feeaba5770d5438ccdddba3d01cba8063e96b8aac4c6daa0ed413dd5ae0554a433a3c4db38df1d134cffc1f languageName: node linkType: hard @@ -7417,11 +7417,11 @@ __metadata: "@effect-ts/build-utils": 0.40.3 "@effect-ts/core": ^0.60.2 "@repo-tooling/eslint-plugin-dprint": ^0.0.4 - "@tsplus/installer": 0.0.132 - "@types/node": ^18.6.4 + "@tsplus/installer": 0.0.133 + "@types/node": ^18.6.5 "@types/rimraf": ^3.0.2 - "@typescript-eslint/eslint-plugin": ^5.32.0 - "@typescript-eslint/parser": ^5.32.0 + "@typescript-eslint/eslint-plugin": ^5.33.0 + "@typescript-eslint/parser": ^5.33.0 babel-plugin-annotate-pure-calls: ^0.4.0 babel-plugin-replace-import-extension: ^1.1.3 c8: ^7.12.0 @@ -7438,8 +7438,8 @@ __metadata: rimraf: ^3.0.2 typescript: ^4.7.4 ultra-runner: ^3.10.5 - vite: ^3.0.4 - vitest: 0.20.3 + vite: ^3.0.5 + vitest: 0.21.1 languageName: unknown linkType: soft @@ -7730,13 +7730,13 @@ __metadata: languageName: node linkType: hard -"vite@npm:^2.9.12 || ^3.0.0-0, vite@npm:^3.0.4": - version: 3.0.4 - resolution: "vite@npm:3.0.4" +"vite@npm:^2.9.12 || ^3.0.0-0, vite@npm:^3.0.5": + version: 3.0.5 + resolution: "vite@npm:3.0.5" dependencies: esbuild: ^0.14.47 fsevents: ~2.3.2 - postcss: ^8.4.14 + postcss: ^8.4.16 resolve: ^1.22.1 rollup: ^2.75.6 peerDependencies: @@ -7758,15 +7758,15 @@ __metadata: optional: true bin: vite: bin/vite.js - checksum: f13eceb94f7b399942ce5e7c10df73314f7b073171d6594228b078cc1203042c4cdb9e8356fe64ad444c3533c31437abb3c64ac56478f0865fab598e924cf68b + checksum: c00ec43356469032fa261872b028740526d5a5726132cb306741e2d9dca241dcb7b0b5d39181d5ebc39c5e82396511080640fa302c66e713a622e8bfa1f14a8d languageName: node linkType: hard -"vitest@npm:0.20.3": - version: 0.20.3 - resolution: "vitest@npm:0.20.3" +"vitest@npm:0.21.1": + version: 0.21.1 + resolution: "vitest@npm:0.21.1" dependencies: - "@types/chai": ^4.3.1 + "@types/chai": ^4.3.3 "@types/chai-subset": ^1.3.3 "@types/node": "*" chai: ^4.3.6 @@ -7797,7 +7797,7 @@ __metadata: optional: true bin: vitest: vitest.mjs - checksum: 1478030f2e34ee91274a544b7d2e2d447969ce37d6452bfbc8e21fe42ec6fb94c496a09b822d7c8d667cee243b6630c871640d4a8b4434e1a25b858dad3548ed + checksum: 27c8cd0a1e2443e1311b1ed236d66caad77dcea2c4b49364475688d89d6f8dba2074b1a2da8e7ca529ded15bd5314ff4b36119a0010a33d2dcd34333d4043bd5 languageName: node linkType: hard