@fncts/base 0.0.18 → 0.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/_cjs/collection/compat/Record/instances.cjs +1 -1
  2. package/_cjs/collection/weak/IterableWeakMap.cjs +7 -1
  3. package/_cjs/collection/weak/IterableWeakMap.cjs.map +1 -1
  4. package/_cjs/data/Branded/definition.cjs +10 -9
  5. package/_cjs/data/Branded/definition.cjs.map +1 -1
  6. package/_cjs/data/Decoder/api.cjs.map +1 -1
  7. package/_cjs/data/Decoder/definition.cjs +1 -0
  8. package/_cjs/data/Decoder/definition.cjs.map +1 -1
  9. package/_cjs/data/Environment/definition.cjs.map +1 -1
  10. package/_cjs/data/{Patch/api.cjs → EnvironmentPatch.cjs} +124 -32
  11. package/_cjs/data/EnvironmentPatch.cjs.map +1 -0
  12. package/_mjs/collection/compat/Record/instances.mjs +1 -1
  13. package/_mjs/collection/weak/IterableWeakMap.mjs +3 -1
  14. package/_mjs/collection/weak/IterableWeakMap.mjs.map +1 -1
  15. package/_mjs/data/Branded/definition.mjs +7 -6
  16. package/_mjs/data/Branded/definition.mjs.map +1 -1
  17. package/_mjs/data/Decoder/api.mjs.map +1 -1
  18. package/_mjs/data/Decoder/definition.mjs +1 -0
  19. package/_mjs/data/Decoder/definition.mjs.map +1 -1
  20. package/_mjs/data/Environment/definition.mjs.map +1 -1
  21. package/_mjs/data/EnvironmentPatch.mjs +184 -0
  22. package/_mjs/data/EnvironmentPatch.mjs.map +1 -0
  23. package/_src/collection/weak/IterableWeakMap.ts +1 -1
  24. package/_src/data/Branded/definition.ts +27 -24
  25. package/_src/data/Branded/derivations.ts +10 -10
  26. package/_src/data/Decoder/api.ts +1 -1
  27. package/_src/data/Decoder/definition.ts +2 -2
  28. package/_src/data/Environment/definition.ts +6 -0
  29. package/_src/data/EnvironmentPatch.ts +136 -0
  30. package/_src/data.ts +1 -1
  31. package/_src/global.ts +5 -1
  32. package/collection/compat/Array/derivations.d.ts +1 -1
  33. package/collection/compat/Record/instances.d.ts +1 -1
  34. package/collection/immutable/Conc/derivations.d.ts +1 -1
  35. package/collection/immutable/ImmutableArray/derivations.d.ts +1 -1
  36. package/collection/immutable/ImmutableNonEmptyArray/derivations.d.ts +1 -1
  37. package/collection/weak/IterableWeakMap.d.ts +1 -1
  38. package/data/Branded/definition.d.ts +25 -22
  39. package/data/Branded/derivations.d.ts +7 -7
  40. package/data/Decoder/api.d.ts +1 -1
  41. package/data/Decoder/definition.d.ts +2 -2
  42. package/data/Either/instances.d.ts +1 -1
  43. package/data/Environment/definition.d.ts +4 -0
  44. package/data/EnvironmentPatch.d.ts +73 -0
  45. package/data/Maybe/instances.d.ts +1 -1
  46. package/data/These/instances.d.ts +1 -1
  47. package/data.d.ts +1 -1
  48. package/global.d.ts +5 -1
  49. package/json/EitherJson.d.ts +1 -1
  50. package/json/MaybeJson.d.ts +1 -1
  51. package/json/TheseJson.d.ts +1 -1
  52. package/package.json +2 -2
  53. package/_cjs/data/Patch/api.cjs.map +0 -1
  54. package/_cjs/data/Patch/definition.cjs +0 -88
  55. package/_cjs/data/Patch/definition.cjs.map +0 -1
  56. package/_cjs/data/Patch.cjs +0 -32
  57. package/_cjs/data/Patch.cjs.map +0 -1
  58. package/_mjs/data/Patch/api.mjs +0 -112
  59. package/_mjs/data/Patch/api.mjs.map +0 -1
  60. package/_mjs/data/Patch/definition.mjs +0 -61
  61. package/_mjs/data/Patch/definition.mjs.map +0 -1
  62. package/_mjs/data/Patch.mjs +0 -4
  63. package/_mjs/data/Patch.mjs.map +0 -1
  64. package/_src/data/Patch/api.ts +0 -75
  65. package/_src/data/Patch/definition.ts +0 -58
  66. package/_src/data/Patch.ts +0 -4
  67. package/data/Patch/api.d.ts +0 -24
  68. package/data/Patch/definition.d.ts +0 -44
  69. package/data/Patch.d.ts +0 -2
@@ -1,58 +0,0 @@
1
- export const PatchTypeId = Symbol.for("fncts.Patch");
2
- export type PatchTypeId = typeof PatchTypeId;
3
-
4
- /**
5
- * @tsplus type fncts.Environment.Patch
6
- * @tsplus companion fncts.Environment.PatchOps
7
- */
8
- export abstract class Patch<In, Out> {
9
- readonly _typeId: PatchTypeId = PatchTypeId;
10
- readonly _R!: (_: In) => void;
11
- readonly _A!: () => Out;
12
- }
13
-
14
- export class AddService<Env, Service> extends Patch<Env, Env & Has<Service>> {
15
- readonly _tag = "AddService";
16
- constructor(readonly service: Service, readonly tag: Tag<Service>) {
17
- super();
18
- }
19
- }
20
-
21
- export class Compose<In, Out, Out2> extends Patch<In, Out2> {
22
- readonly _tag = "Compose";
23
- constructor(readonly first: Patch<In, Out>, readonly second: Patch<Out, Out2>) {
24
- super();
25
- }
26
- }
27
-
28
- export class Empty<Env> extends Patch<Env, Env> {
29
- readonly _tag = "Empty";
30
- }
31
-
32
- export class RemoveService<Env, Service> extends Patch<Env & Has<Service>, Env> {
33
- readonly _tag = "RemoveService";
34
- constructor(readonly tag: Tag<Service>) {
35
- super();
36
- }
37
- }
38
-
39
- export class UpdateService<Env, Service> extends Patch<Env & Has<Service>, Env & Has<Service>> {
40
- readonly _tag = "UpdateService";
41
- constructor(readonly update: (_: Service) => Service, readonly tag: Tag<Service>) {
42
- super();
43
- }
44
- }
45
-
46
- export type Concrete =
47
- | AddService<any, any>
48
- | Compose<any, any, any>
49
- | Empty<any>
50
- | RemoveService<any, any>
51
- | UpdateService<any, any>;
52
-
53
- /**
54
- * @tsplus macro remove
55
- */
56
- export function concrete(_: Patch<any, any>): asserts _ is Concrete {
57
- //
58
- }
@@ -1,4 +0,0 @@
1
- // codegen:start { preset: barrel, include: ./Patch/*.ts }
2
- export * from "./Patch/api.js";
3
- export * from "./Patch/definition.js";
4
- // codegen:end
@@ -1,24 +0,0 @@
1
- import { Environment } from "@fncts/base/data/Environment/definition";
2
- import { List } from "@fncts/base/collection/immutable/List/definition";
3
- import { Tag } from "@fncts/base/data/Tag/definition";
4
- import { Patch } from "@fncts/base/data/Patch/definition";
5
- /**
6
- * @tsplus fluent fncts.Environment.Patch __call
7
- * @tsplus location "@fncts/base/data/Patch/api"
8
- */
9
- export declare function apply<In, Out>(patch: Patch<In, Out>, environment: Environment<In>): Environment<Out>;
10
- /**
11
- * @tsplus fluent fncts.Environment.Patch compose
12
- * @tsplus location "@fncts/base/data/Patch/api"
13
- */
14
- export declare function compose<In, Out, Out2>(self: Patch<In, Out>, that: Patch<Out, Out2>): Patch<In, Out2>;
15
- /**
16
- * @tsplus static fncts.Environment.PatchOps diff
17
- * @tsplus location "@fncts/base/data/Patch/api"
18
- */
19
- export declare function diff<In, Out>(oldValue: Environment<In>, newValue: Environment<Out>): Patch<In, Out>;
20
- /**
21
- * @tsplus static fncts.Environment.PatchOps empty
22
- * @tsplus location "@fncts/base/data/Patch/api"
23
- */
24
- export declare function empty<A>(): Patch<A, A>;
@@ -1,44 +0,0 @@
1
- import { Has } from "@fncts/base/typeclass/Has";
2
- import { Tag } from "@fncts/base/data/Tag/definition";
3
- export declare const PatchTypeId: unique symbol;
4
- export type PatchTypeId = typeof PatchTypeId;
5
- /**
6
- * @tsplus type fncts.Environment.Patch
7
- * @tsplus companion fncts.Environment.PatchOps
8
- */
9
- export declare abstract class Patch<In, Out> {
10
- readonly _typeId: PatchTypeId;
11
- readonly _R: (_: In) => void;
12
- readonly _A: () => Out;
13
- }
14
- export declare class AddService<Env, Service> extends Patch<Env, Env & Has<Service>> {
15
- readonly service: Service;
16
- readonly tag: Tag<Service>;
17
- readonly _tag = "AddService";
18
- constructor(service: Service, tag: Tag<Service>);
19
- }
20
- export declare class Compose<In, Out, Out2> extends Patch<In, Out2> {
21
- readonly first: Patch<In, Out>;
22
- readonly second: Patch<Out, Out2>;
23
- readonly _tag = "Compose";
24
- constructor(first: Patch<In, Out>, second: Patch<Out, Out2>);
25
- }
26
- export declare class Empty<Env> extends Patch<Env, Env> {
27
- readonly _tag = "Empty";
28
- }
29
- export declare class RemoveService<Env, Service> extends Patch<Env & Has<Service>, Env> {
30
- readonly tag: Tag<Service>;
31
- readonly _tag = "RemoveService";
32
- constructor(tag: Tag<Service>);
33
- }
34
- export declare class UpdateService<Env, Service> extends Patch<Env & Has<Service>, Env & Has<Service>> {
35
- readonly update: (_: Service) => Service;
36
- readonly tag: Tag<Service>;
37
- readonly _tag = "UpdateService";
38
- constructor(update: (_: Service) => Service, tag: Tag<Service>);
39
- }
40
- export type Concrete = AddService<any, any> | Compose<any, any, any> | Empty<any> | RemoveService<any, any> | UpdateService<any, any>;
41
- /**
42
- * @tsplus macro remove
43
- */
44
- export declare function concrete(_: Patch<any, any>): asserts _ is Concrete;
package/data/Patch.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from "./Patch/api.js";
2
- export * from "./Patch/definition.js";