liminal 0.4.0 → 1.0.0-beta.2

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 (239) hide show
  1. package/LICENSE +201 -15
  2. package/README.md +96 -81
  3. package/esm/client/Client.d.ts +39 -0
  4. package/esm/client/Client.d.ts.map +1 -0
  5. package/esm/client/Client.js +9 -0
  6. package/esm/client/Client.js.map +1 -0
  7. package/esm/client/Store.d.ts +3 -0
  8. package/esm/client/Store.d.ts.map +1 -0
  9. package/esm/client/Store.js +3 -0
  10. package/esm/client/Store.js.map +1 -0
  11. package/esm/client/Tx.d.ts +40 -0
  12. package/esm/client/Tx.d.ts.map +1 -0
  13. package/esm/client/Tx.js +36 -0
  14. package/esm/client/Tx.js.map +1 -0
  15. package/esm/client/mod.d.ts +4 -0
  16. package/esm/client/mod.d.ts.map +1 -0
  17. package/esm/client/mod.js +5 -0
  18. package/esm/client/mod.js.map +1 -0
  19. package/esm/core/Bool.d.ts +104 -0
  20. package/esm/core/Bool.d.ts.map +1 -0
  21. package/esm/core/Bool.js +73 -0
  22. package/esm/core/Bool.js.map +1 -0
  23. package/esm/core/Bytes.d.ts +39 -0
  24. package/esm/core/Bytes.d.ts.map +1 -0
  25. package/esm/core/Bytes.js +7 -0
  26. package/esm/core/Bytes.js.map +1 -0
  27. package/esm/core/Call.d.ts +11 -0
  28. package/esm/core/Call.d.ts.map +1 -0
  29. package/esm/core/Call.js +23 -0
  30. package/esm/core/Call.js.map +1 -0
  31. package/esm/core/Effect.d.ts +20 -0
  32. package/esm/core/Effect.d.ts.map +1 -0
  33. package/esm/core/Effect.js +37 -0
  34. package/esm/core/Effect.js.map +1 -0
  35. package/esm/core/Hash.d.ts +41 -0
  36. package/esm/core/Hash.d.ts.map +1 -0
  37. package/esm/core/Hash.js +8 -0
  38. package/esm/core/Hash.js.map +1 -0
  39. package/esm/core/Id.d.ts +198 -0
  40. package/esm/core/Id.d.ts.map +1 -0
  41. package/esm/core/Id.js +69 -0
  42. package/esm/core/Id.js.map +1 -0
  43. package/esm/core/Int.d.ts +768 -0
  44. package/esm/core/Int.d.ts.map +1 -0
  45. package/esm/core/Int.js +201 -0
  46. package/esm/core/Int.js.map +1 -0
  47. package/esm/core/Key.d.ts +40 -0
  48. package/esm/core/Key.d.ts.map +1 -0
  49. package/esm/core/Key.js +7 -0
  50. package/esm/core/Key.js.map +1 -0
  51. package/esm/core/MerkleList.d.ts +105 -0
  52. package/esm/core/MerkleList.d.ts.map +1 -0
  53. package/esm/core/MerkleList.js +82 -0
  54. package/esm/core/MerkleList.js.map +1 -0
  55. package/esm/core/MerkleMap.d.ts +87 -0
  56. package/esm/core/MerkleMap.d.ts.map +1 -0
  57. package/esm/core/MerkleMap.js +67 -0
  58. package/esm/core/MerkleMap.js.map +1 -0
  59. package/esm/core/None.d.ts +52 -0
  60. package/esm/core/None.d.ts.map +1 -0
  61. package/esm/core/None.js +12 -0
  62. package/esm/core/None.js.map +1 -0
  63. package/esm/core/State.d.ts +16 -0
  64. package/esm/core/State.d.ts.map +1 -0
  65. package/esm/core/State.js +22 -0
  66. package/esm/core/State.js.map +1 -0
  67. package/esm/core/String.d.ts +41 -0
  68. package/esm/core/String.d.ts.map +1 -0
  69. package/esm/core/String.js +4 -0
  70. package/esm/core/String.js.map +1 -0
  71. package/esm/core/Struct.d.ts +58 -0
  72. package/esm/core/Struct.d.ts.map +1 -0
  73. package/esm/core/Struct.js +13 -0
  74. package/esm/core/Struct.js.map +1 -0
  75. package/esm/core/Type.d.ts +78 -0
  76. package/esm/core/Type.d.ts.map +1 -0
  77. package/esm/core/Type.js +71 -0
  78. package/esm/core/Type.js.map +1 -0
  79. package/esm/core/Union.d.ts +43 -0
  80. package/esm/core/Union.d.ts.map +1 -0
  81. package/esm/core/Union.js +7 -0
  82. package/esm/core/Union.js.map +1 -0
  83. package/esm/core/Use.d.ts +62 -0
  84. package/esm/core/Use.d.ts.map +1 -0
  85. package/esm/core/Use.js +16 -0
  86. package/esm/core/Use.js.map +1 -0
  87. package/esm/core/mod.d.ts +18 -0
  88. package/esm/core/mod.d.ts.map +1 -0
  89. package/esm/core/mod.js +19 -0
  90. package/esm/core/mod.js.map +1 -0
  91. package/esm/lib/MerkleList.d.ts +4 -0
  92. package/esm/lib/MerkleList.d.ts.map +1 -0
  93. package/esm/lib/MerkleList.js +4 -0
  94. package/esm/lib/MerkleList.js.map +1 -0
  95. package/esm/lib/MerkleMap.d.ts +4 -0
  96. package/esm/lib/MerkleMap.d.ts.map +1 -0
  97. package/esm/lib/MerkleMap.js +4 -0
  98. package/esm/lib/MerkleMap.js.map +1 -0
  99. package/esm/lib/mod.d.ts +3 -0
  100. package/esm/lib/mod.d.ts.map +1 -0
  101. package/esm/lib/mod.js +3 -0
  102. package/esm/lib/mod.js.map +1 -0
  103. package/esm/mod.d.ts +3 -0
  104. package/esm/mod.d.ts.map +1 -0
  105. package/esm/mod.js +4 -0
  106. package/esm/mod.js.map +1 -0
  107. package/esm/package.json +3 -0
  108. package/esm/test/Signer.d.ts +10 -0
  109. package/esm/test/Signer.d.ts.map +1 -0
  110. package/esm/test/Signer.js +13 -0
  111. package/esm/test/Signer.js.map +1 -0
  112. package/esm/test/mod.d.ts +2 -0
  113. package/esm/test/mod.d.ts.map +1 -0
  114. package/esm/test/mod.js +2 -0
  115. package/esm/test/mod.js.map +1 -0
  116. package/esm/util/AbortController.d.ts +4 -0
  117. package/esm/util/AbortController.d.ts.map +1 -0
  118. package/esm/util/AbortController.js +2 -0
  119. package/esm/util/AbortController.js.map +1 -0
  120. package/esm/util/ArrayOfLength.d.ts +2 -0
  121. package/esm/util/ArrayOfLength.d.ts.map +1 -0
  122. package/esm/util/ArrayOfLength.js +2 -0
  123. package/esm/util/ArrayOfLength.js.map +1 -0
  124. package/esm/util/Flatten.d.ts +4 -0
  125. package/esm/util/Flatten.d.ts.map +1 -0
  126. package/esm/util/Flatten.js +2 -0
  127. package/esm/util/Flatten.js.map +1 -0
  128. package/esm/util/Rest.d.ts +2 -0
  129. package/esm/util/Rest.d.ts.map +1 -0
  130. package/esm/util/Rest.js +2 -0
  131. package/esm/util/Rest.js.map +1 -0
  132. package/esm/util/Subscription.d.ts +5 -0
  133. package/esm/util/Subscription.d.ts.map +1 -0
  134. package/esm/util/Subscription.js +2 -0
  135. package/esm/util/Subscription.js.map +1 -0
  136. package/esm/util/Tagged.d.ts +6 -0
  137. package/esm/util/Tagged.d.ts.map +1 -0
  138. package/esm/util/Tagged.js +6 -0
  139. package/esm/util/Tagged.js.map +1 -0
  140. package/esm/util/U2I.d.ts +2 -0
  141. package/esm/util/U2I.d.ts.map +1 -0
  142. package/esm/util/U2I.js +2 -0
  143. package/esm/util/U2I.js.map +1 -0
  144. package/esm/util/generator/collect.d.ts +3 -0
  145. package/esm/util/generator/collect.d.ts.map +1 -0
  146. package/esm/util/generator/collect.js +16 -0
  147. package/esm/util/generator/collect.js.map +1 -0
  148. package/esm/util/isKey.d.ts +2 -0
  149. package/esm/util/isKey.d.ts.map +1 -0
  150. package/esm/util/isKey.js +8 -0
  151. package/esm/util/isKey.js.map +1 -0
  152. package/esm/util/unimplemented.d.ts +2 -0
  153. package/esm/util/unimplemented.d.ts.map +1 -0
  154. package/esm/util/unimplemented.js +6 -0
  155. package/esm/util/unimplemented.js.map +1 -0
  156. package/package.json +21 -21
  157. package/src/client/Client.ts +49 -0
  158. package/src/client/Store.ts +1 -0
  159. package/src/client/Tx.ts +62 -0
  160. package/src/client/mod.ts +5 -0
  161. package/src/core/Bool.ts +75 -0
  162. package/src/core/Bytes.ts +9 -0
  163. package/src/core/Call.ts +38 -0
  164. package/src/core/Effect.ts +87 -0
  165. package/src/core/Hash.ts +23 -0
  166. package/src/core/Id.ts +97 -0
  167. package/src/core/Int.ts +177 -0
  168. package/src/core/Key.ts +9 -0
  169. package/src/core/MerkleList.ts +92 -0
  170. package/src/core/MerkleMap.ts +86 -0
  171. package/src/core/None.ts +11 -0
  172. package/src/core/State.ts +31 -0
  173. package/src/core/String.ts +5 -0
  174. package/src/core/Struct.ts +49 -0
  175. package/src/core/Type.ts +120 -0
  176. package/src/core/Union.ts +17 -0
  177. package/src/core/Use.ts +33 -0
  178. package/src/core/mod.ts +19 -0
  179. package/src/lib/MerkleList.ts +4 -0
  180. package/src/lib/MerkleMap.ts +4 -0
  181. package/src/lib/mod.ts +2 -0
  182. package/src/mod.ts +4 -0
  183. package/src/test/Signer.ts +22 -0
  184. package/src/test/mod.ts +1 -0
  185. package/src/util/AbortController.ts +3 -0
  186. package/src/util/ArrayOfLength.ts +5 -0
  187. package/src/util/Flatten.ts +2 -0
  188. package/src/util/Rest.ts +1 -0
  189. package/src/util/Subscription.ts +5 -0
  190. package/src/util/Tagged.ts +5 -0
  191. package/src/util/U2I.ts +1 -0
  192. package/src/util/generator/collect.ts +16 -0
  193. package/src/util/isKey.ts +7 -0
  194. package/src/util/unimplemented.ts +4 -0
  195. package/jest.config.js +0 -4
  196. package/lib/array/array.d.ts +0 -6
  197. package/lib/array/array.js +0 -21
  198. package/lib/array/index.d.ts +0 -11
  199. package/lib/array/index.js +0 -17
  200. package/lib/composition/composition.d.ts +0 -6
  201. package/lib/composition/composition.js +0 -37
  202. package/lib/composition/index.d.ts +0 -9
  203. package/lib/composition/index.js +0 -13
  204. package/lib/composition/types.d.ts +0 -2
  205. package/lib/composition/types.js +0 -2
  206. package/lib/dispatch/getType.d.ts +0 -2
  207. package/lib/dispatch/getType.js +0 -15
  208. package/lib/dispatch/identity.d.ts +0 -2
  209. package/lib/dispatch/identity.js +0 -4
  210. package/lib/dispatch/index.d.ts +0 -22
  211. package/lib/dispatch/index.js +0 -13
  212. package/lib/dispatch/types.d.ts +0 -14
  213. package/lib/dispatch/types.js +0 -16
  214. package/lib/error/error.d.ts +0 -24
  215. package/lib/error/error.js +0 -25
  216. package/lib/error/index.d.ts +0 -2
  217. package/lib/error/index.js +0 -4
  218. package/lib/index.d.ts +0 -67
  219. package/lib/index.js +0 -19
  220. package/lib/multimethod/index.d.ts +0 -7
  221. package/lib/multimethod/index.js +0 -9
  222. package/lib/multimethod/multimethod.d.ts +0 -3
  223. package/lib/multimethod/multimethod.js +0 -101
  224. package/src/array/array.ts +0 -29
  225. package/src/array/index.ts +0 -12
  226. package/src/composition/composition.ts +0 -45
  227. package/src/composition/index.ts +0 -10
  228. package/src/composition/types.ts +0 -6
  229. package/src/dispatch/getType.ts +0 -17
  230. package/src/dispatch/identity.ts +0 -3
  231. package/src/dispatch/index.ts +0 -11
  232. package/src/dispatch/types.ts +0 -15
  233. package/src/error/error.ts +0 -26
  234. package/src/error/index.ts +0 -3
  235. package/src/index.ts +0 -15
  236. package/src/multimethod/index.ts +0 -8
  237. package/src/multimethod/multimethod.test.ts +0 -10
  238. package/src/multimethod/multimethod.ts +0 -148
  239. package/tsconfig.json +0 -12
@@ -0,0 +1,104 @@
1
+ import { Call, Result, Yield } from "./Call.js";
2
+ import { Effect } from "./Effect.js";
3
+ import { None } from "./None.js";
4
+ import { Factory, Type } from "./Type.js";
5
+ declare const bool_base: {
6
+ new <Source, Native = never, From = Native, Into extends Type<any, any, any, any, any> = never>(source: import("./Type.js").TypeSource | Source): {
7
+ ""?: [Native, From, Into] | undefined;
8
+ readonly typeName: "bool";
9
+ readonly source: import("./Type.js").TypeSource | Source;
10
+ ctor: new (source: import("./Type.js").TypeSource | Source) => any;
11
+ into<O extends Into>(into: Factory<O>): O;
12
+ equals<T extends Type<any, any, any, any, any>>(this: T, inQuestion: T): bool;
13
+ is<T_1 extends Type<any, any, any, any, any>, M extends Factory<T_1>>(this: T_1, match: M): bool;
14
+ case<T_2 extends Type<any, any, any, any, any>, M_1 extends Factory<T_2>, R extends Result, U extends R | Exclude<T_2, InstanceType<M_1>>>(this: T_2, match: M_1, f: import("./Call.js").ValueCall<R, [InstanceType<M_1>]>): U;
15
+ case<T_3 extends Type<any, any, any, any, any>, M_2 extends Factory<T_3>, Y extends Yield, R_1 extends Result, U_1 extends R_1 | Exclude<T_3, InstanceType<M_2>>>(this: T_3, match: M_2, f: import("./Call.js").GenCall<Y, R_1, [InstanceType<M_2>]>): Effect<Y, U_1>;
16
+ "?"<T_4 extends Type<any, any, any, any, any>, M_3 extends Factory<T_4>>(this: T_4, match: M_3): Effect<InstanceType<M_3>, Exclude<T_4, InstanceType<M_3>>>;
17
+ "?"<T_5 extends Type<any, any, any, any, any>, M_4 extends Factory<T_5>, W extends Type<any, any, any, any, any>>(this: T_5, match: M_4, with_: W): Effect<W, Exclude<T_5, InstanceType<M_4>>>;
18
+ };
19
+ make<Name extends string>(name: Name): {
20
+ new <Source_1, Native_1 = never, From_1 = Native_1, Into_1 extends Type<any, any, any, any, any> = never>(source: Source_1 | import("./Type.js").TypeSource): {
21
+ ""?: [Native_1, From_1, Into_1] | undefined;
22
+ readonly typeName: Name;
23
+ readonly source: Source_1 | import("./Type.js").TypeSource;
24
+ ctor: new (source: Source_1 | import("./Type.js").TypeSource) => any;
25
+ into<O_1 extends Into_1>(into: Factory<O_1>): O_1;
26
+ equals<T_6 extends Type<any, any, any, any, any>>(this: T_6, inQuestion: T_6): bool;
27
+ is<T_7 extends Type<any, any, any, any, any>, M_5 extends Factory<T_7>>(this: T_7, match: M_5): bool;
28
+ case<T_8 extends Type<any, any, any, any, any>, M_6 extends Factory<T_8>, R_2 extends Result, U_2 extends R_2 | Exclude<T_8, InstanceType<M_6>>>(this: T_8, match: M_6, f: import("./Call.js").ValueCall<R_2, [InstanceType<M_6>]>): U_2;
29
+ case<T_9 extends Type<any, any, any, any, any>, M_7 extends Factory<T_9>, Y_1 extends Yield, R_3 extends Result, U_3 extends R_3 | Exclude<T_9, InstanceType<M_7>>>(this: T_9, match: M_7, f: import("./Call.js").GenCall<Y_1, R_3, [InstanceType<M_7>]>): Effect<Y_1, U_3>;
30
+ "?"<T_10 extends Type<any, any, any, any, any>, M_8 extends Factory<T_10>>(this: T_10, match: M_8): Effect<InstanceType<M_8>, Exclude<T_10, InstanceType<M_8>>>;
31
+ "?"<T_11 extends Type<any, any, any, any, any>, M_9 extends Factory<T_11>, W_1 extends Type<any, any, any, any, any>>(this: T_11, match: M_9, with_: W_1): Effect<W_1, Exclude<T_11, InstanceType<M_9>>>;
32
+ };
33
+ make<Name extends string>(name: Name): any;
34
+ "new"<T_12 extends Type<any, any, any, any, any>>(this: Factory<T_12>, ...[value]: import("../util/Rest.js").Rest<Type.From<T_12>>): T_12;
35
+ state<T_13 extends Type<any, any, any, any, any>>(this: Factory<T_13>): import("./State.js").State<T_13>;
36
+ };
37
+ "new"<T_12 extends Type<any, any, any, any, any>>(this: Factory<T_12>, ...[value]: import("../util/Rest.js").Rest<Type.From<T_12>>): T_12;
38
+ state<T_13 extends Type<any, any, any, any, any>>(this: Factory<T_13>): import("./State.js").State<T_13>;
39
+ };
40
+ export declare class bool extends bool_base<BoolSource, boolean, never, never> {
41
+ if<R extends Result>(call: R | (() => R)): If<never, R>;
42
+ if<Y extends Yield, R extends Result>(call: Generator<Y, R> | (() => Generator<Y, R>)): If<Y, R>;
43
+ not(): bool;
44
+ assert<E extends Type>(_error: E): Effect<E, never>;
45
+ }
46
+ export declare class If<Y extends Yield, R extends Result> extends Effect<Y, R | None> {
47
+ readonly self: bool;
48
+ readonly call: Call<Y, R>;
49
+ constructor(self: bool, call: Call<Y, R>);
50
+ else<R2 extends Result>(call: R2 | (() => R2)): [Y] extends [never] ? R | R2 : Effect<Y, R | R2>;
51
+ else<Y2 extends Yield, R2 extends Result>(call: Generator<Y2, R2> | (() => Generator<Y2, R2>)): Effect<Y | Y2, R | R2>;
52
+ }
53
+ export type BoolSource = BoolSource.True | BoolSource.False | BoolSource.Not | BoolSource.Equals | BoolSource.Is;
54
+ export declare namespace BoolSource {
55
+ const True_base: {
56
+ new (): {
57
+ readonly tag: "True";
58
+ };
59
+ };
60
+ export class True extends True_base {
61
+ }
62
+ const False_base: {
63
+ new (): {
64
+ readonly tag: "False";
65
+ };
66
+ };
67
+ export class False extends False_base {
68
+ }
69
+ const Not_base: {
70
+ new (): {
71
+ readonly tag: "Not";
72
+ };
73
+ };
74
+ export class Not extends Not_base {
75
+ readonly not: bool;
76
+ constructor(not: bool);
77
+ }
78
+ const Equals_base: {
79
+ new (): {
80
+ readonly tag: "Equals";
81
+ };
82
+ };
83
+ export class Equals extends Equals_base {
84
+ readonly left: Type;
85
+ readonly right: Type;
86
+ constructor(left: Type, right: Type);
87
+ }
88
+ const Is_base: {
89
+ new (): {
90
+ readonly tag: "Is";
91
+ };
92
+ };
93
+ export class Is extends Is_base {
94
+ readonly inQuestion: Type;
95
+ readonly match: Factory;
96
+ constructor(inQuestion: Type, match: Factory);
97
+ }
98
+ export {};
99
+ }
100
+ declare const true_: bool;
101
+ export { true_ as true };
102
+ declare const false_: bool;
103
+ export { false_ as false };
104
+ //# sourceMappingURL=Bool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Bool.d.ts","sourceRoot":"","sources":["../../src/core/Bool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,WAAW,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEzC,qBAAa,IAAK,SAAQ,UAAkB,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC;IAC5E,EAAE,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC;IACvD,EAAE,CAAC,CAAC,SAAS,KAAK,EAAE,CAAC,SAAS,MAAM,EAClC,IAAI,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC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AG;;;;;;IAC7C,MAAM,OAAO,GAAI,SAAQ,QAAa;QACxB,QAAQ,CAAC,GAAG,EAAE,IAAI;oBAAT,GAAG,EAAE,IAAI;KAG/B;;;;;;IACD,MAAM,OAAO,MAAO,SAAQ,WAAgB;QAC9B,QAAQ,CAAC,IAAI,EAAE,IAAI;QAAE,QAAQ,CAAC,KAAK,EAAE,IAAI;oBAAhC,IAAI,EAAE,IAAI,EAAW,KAAK,EAAE,IAAI;KAGtD;;;;;;IACD,MAAM,OAAO,EAAG,SAAQ,OAAY;QACtB,QAAQ,CAAC,UAAU,EAAE,IAAI;QAAE,QAAQ,CAAC,KAAK,EAAE,OAAO;oBAAzC,UAAU,EAAE,IAAI,EAAW,KAAK,EAAE,OAAO;KAG/D;;CACF;AAED,QAAA,MAAM,KAAK,MAAkC,CAAA;AAC7C,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,CAAA;AAExB,QAAA,MAAM,MAAM,MAAmC,CAAA;AAC/C,OAAO,EAAE,MAAM,IAAI,KAAK,EAAE,CAAA"}
@@ -0,0 +1,73 @@
1
+ import { Tagged } from "../util/Tagged.js";
2
+ import { unimplemented } from "../util/unimplemented.js";
3
+ import { Call } from "./Call.js";
4
+ import { Effect } from "./Effect.js";
5
+ import { Type } from "./Type.js";
6
+ export class bool extends Type.make("bool") {
7
+ if(call) {
8
+ return new If(this, call);
9
+ }
10
+ not() {
11
+ return new bool(new BoolSource.Not(this));
12
+ }
13
+ assert(_error) {
14
+ unimplemented();
15
+ }
16
+ }
17
+ export class If extends Effect {
18
+ self;
19
+ call;
20
+ constructor(self, call) {
21
+ super();
22
+ this.self = self;
23
+ this.call = call;
24
+ const [yields, result] = Call.collect(call);
25
+ this.yields = yields;
26
+ this.result = result;
27
+ }
28
+ else(_call) {
29
+ return unimplemented();
30
+ }
31
+ }
32
+ export var BoolSource;
33
+ (function (BoolSource) {
34
+ class True extends Tagged("True") {
35
+ }
36
+ BoolSource.True = True;
37
+ class False extends Tagged("False") {
38
+ }
39
+ BoolSource.False = False;
40
+ class Not extends Tagged("Not") {
41
+ not;
42
+ constructor(not) {
43
+ super();
44
+ this.not = not;
45
+ }
46
+ }
47
+ BoolSource.Not = Not;
48
+ class Equals extends Tagged("Equals") {
49
+ left;
50
+ right;
51
+ constructor(left, right) {
52
+ super();
53
+ this.left = left;
54
+ this.right = right;
55
+ }
56
+ }
57
+ BoolSource.Equals = Equals;
58
+ class Is extends Tagged("Is") {
59
+ inQuestion;
60
+ match;
61
+ constructor(inQuestion, match) {
62
+ super();
63
+ this.inQuestion = inQuestion;
64
+ this.match = match;
65
+ }
66
+ }
67
+ BoolSource.Is = Is;
68
+ })(BoolSource || (BoolSource = {}));
69
+ const true_ = new bool(new BoolSource.True());
70
+ export { true_ as true };
71
+ const false_ = new bool(new BoolSource.False());
72
+ export { false_ as false };
73
+ //# sourceMappingURL=Bool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Bool.js","sourceRoot":"","sources":["../../src/core/Bool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EAAE,IAAI,EAAiB,MAAM,WAAW,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,OAAO,EAAW,IAAI,EAAE,MAAM,WAAW,CAAA;AAEzC,MAAM,OAAO,IAAK,SAAQ,IAAI,CAAC,IAAI,CAAC,MAAM,CAAoC;IAK5E,EAAE,CAAC,IAAS;QACV,OAAO,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IAC3B,CAAC;IAED,GAAG;QACD,OAAO,IAAI,IAAI,CAAC,IAAI,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;IAC3C,CAAC;IAED,MAAM,CAAiB,MAAS;QAC9B,aAAa,EAAE,CAAA;IACjB,CAAC;CACF;AAED,MAAM,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aAAE,KAId,CAAA;AACH,CAAC,EAlBgB,UAAU,KAAV,UAAU,QAkB1B;AAED,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC,CAAA;AAC7C,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,CAAA;AAExB,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,IAAI,UAAU,CAAC,KAAK,EAAE,CAAC,CAAA;AAC/C,OAAO,EAAE,MAAM,IAAI,KAAK,EAAE,CAAA"}
@@ -0,0 +1,39 @@
1
+ import { Type } from "./Type.js";
2
+ export declare function Bytes<Size extends number>(size: Size): {
3
+ new (source: import("./Type.js").TypeSource): {
4
+ size: Size;
5
+ ""?: [Uint8Array, Uint8Array, never] | undefined;
6
+ readonly typeName: "Bytes";
7
+ readonly source: import("./Type.js").TypeSource;
8
+ ctor: new (source: import("./Type.js").TypeSource) => any;
9
+ into<O extends never>(into: import("./Type.js").Factory<O>): O;
10
+ equals<T extends Type<any, any, any, any, any>>(this: T, inQuestion: T): import("./Bool.js").bool;
11
+ is<T_1 extends Type<any, any, any, any, any>, M extends import("./Type.js").Factory<T_1>>(this: T_1, match: M): import("./Bool.js").bool;
12
+ case<T_2 extends Type<any, any, any, any, any>, M_1 extends import("./Type.js").Factory<T_2>, R extends import("./Call.js").Result, U extends R | Exclude<T_2, InstanceType<M_1>>>(this: T_2, match: M_1, f: import("./Call.js").ValueCall<R, [InstanceType<M_1>]>): U;
13
+ case<T_3 extends Type<any, any, any, any, any>, M_2 extends import("./Type.js").Factory<T_3>, Y extends import("./Call.js").Yield, R_1 extends import("./Call.js").Result, U_1 extends R_1 | Exclude<T_3, InstanceType<M_2>>>(this: T_3, match: M_2, f: import("./Call.js").GenCall<Y, R_1, [InstanceType<M_2>]>): import("./Effect.js").Effect<Y, U_1>;
14
+ "?"<T_4 extends Type<any, any, any, any, any>, M_3 extends import("./Type.js").Factory<T_4>>(this: T_4, match: M_3): import("./Effect.js").Effect<InstanceType<M_3>, Exclude<T_4, InstanceType<M_3>>>;
15
+ "?"<T_5 extends Type<any, any, any, any, any>, M_4 extends import("./Type.js").Factory<T_5>, W extends Type<any, any, any, any, any>>(this: T_5, match: M_4, with_: W): import("./Effect.js").Effect<W, Exclude<T_5, InstanceType<M_4>>>;
16
+ };
17
+ make<Name extends string>(name: Name): {
18
+ new <Source, Native = never, From = Native, Into extends Type<any, any, any, any, any> = never>(source: Source | import("./Type.js").TypeSource): {
19
+ ""?: [Native, From, Into] | undefined;
20
+ readonly typeName: Name;
21
+ readonly source: Source | import("./Type.js").TypeSource;
22
+ ctor: new (source: Source | import("./Type.js").TypeSource) => any;
23
+ into<O_1 extends Into>(into: import("./Type.js").Factory<O_1>): O_1;
24
+ equals<T_6 extends Type<any, any, any, any, any>>(this: T_6, inQuestion: T_6): import("./Bool.js").bool;
25
+ is<T_7 extends Type<any, any, any, any, any>, M_5 extends import("./Type.js").Factory<T_7>>(this: T_7, match: M_5): import("./Bool.js").bool;
26
+ case<T_8 extends Type<any, any, any, any, any>, M_6 extends import("./Type.js").Factory<T_8>, R_2 extends import("./Call.js").Result, U_2 extends R_2 | Exclude<T_8, InstanceType<M_6>>>(this: T_8, match: M_6, f: import("./Call.js").ValueCall<R_2, [InstanceType<M_6>]>): U_2;
27
+ case<T_9 extends Type<any, any, any, any, any>, M_7 extends import("./Type.js").Factory<T_9>, Y_1 extends import("./Call.js").Yield, R_3 extends import("./Call.js").Result, U_3 extends R_3 | Exclude<T_9, InstanceType<M_7>>>(this: T_9, match: M_7, f: import("./Call.js").GenCall<Y_1, R_3, [InstanceType<M_7>]>): import("./Effect.js").Effect<Y_1, U_3>;
28
+ "?"<T_10 extends Type<any, any, any, any, any>, M_8 extends import("./Type.js").Factory<T_10>>(this: T_10, match: M_8): import("./Effect.js").Effect<InstanceType<M_8>, Exclude<T_10, InstanceType<M_8>>>;
29
+ "?"<T_11 extends Type<any, any, any, any, any>, M_9 extends import("./Type.js").Factory<T_11>, W_1 extends Type<any, any, any, any, any>>(this: T_11, match: M_9, with_: W_1): import("./Effect.js").Effect<W_1, Exclude<T_11, InstanceType<M_9>>>;
30
+ };
31
+ make<Name extends string>(name: Name): any;
32
+ "new"<T_12 extends Type<any, any, any, any, any>>(this: import("./Type.js").Factory<T_12>, ...[value]: import("../util/Rest.js").Rest<Type.From<T_12>>): T_12;
33
+ state<T_13 extends Type<any, any, any, any, any>>(this: import("./Type.js").Factory<T_13>): import("./State.js").State<T_13>;
34
+ };
35
+ "new"<T_12 extends Type<any, any, any, any, any>>(this: import("./Type.js").Factory<T_12>, ...[value]: import("../util/Rest.js").Rest<Type.From<T_12>>): T_12;
36
+ state<T_13 extends Type<any, any, any, any, any>>(this: import("./Type.js").Factory<T_13>): import("./State.js").State<T_13>;
37
+ };
38
+ export type BytesSource = never;
39
+ //# sourceMappingURL=Bytes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Bytes.d.ts","sourceRoot":"","sources":["../../src/core/Bytes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,wBAAgB,KAAK,CAAC,IAAI,SAAS,MAAM,EAAE,IAAI,EAAE,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIpD;AAED,MAAM,MAAM,WAAW,GAAG,KAAK,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { Type } from "./Type.js";
2
+ export function Bytes(size) {
3
+ return class extends Type.make("Bytes") {
4
+ size = size;
5
+ };
6
+ }
7
+ //# sourceMappingURL=Bytes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Bytes.js","sourceRoot":"","sources":["../../src/core/Bytes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,MAAM,UAAU,KAAK,CAAsB,IAAU;IACnD,OAAO,KAAM,SAAQ,IAAI,CAAC,IAAI,CAAC,OAAO,CAA0B;QAC9D,IAAI,GAAG,IAAI,CAAA;KACZ,CAAA;AACH,CAAC"}
@@ -0,0 +1,11 @@
1
+ import * as G from "../util/generator/collect.js";
2
+ import { Type } from "./Type.js";
3
+ export type Yield = Type;
4
+ export type Result = Type | void;
5
+ export type ValueCall<R, A extends unknown[]> = R | ((...args: A) => R);
6
+ export type GenCall<Y extends Yield = any, R extends Result = any, A extends unknown[] = any> = Generator<Y, R> | ((...args: A) => Generator<Y, R>);
7
+ export type Call<Y extends Yield = any, R extends Result = any, A extends unknown[] = any> = ValueCall<R, A> | GenCall<Y, R, A>;
8
+ export declare namespace Call {
9
+ function collect<Y extends Yield, R extends Result>(call: Call<Y, R>): G.Collected<Y, R>;
10
+ }
11
+ //# sourceMappingURL=Call.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Call.d.ts","sourceRoot":"","sources":["../../src/core/Call.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,MAAM,MAAM,KAAK,GAAG,IAAI,CAAA;AACxB,MAAM,MAAM,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;AAEhC,MAAM,MAAM,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;AAEvE,MAAM,MAAM,OAAO,CACjB,CAAC,SAAS,KAAK,GAAG,GAAG,EACrB,CAAC,SAAS,MAAM,GAAG,GAAG,EACtB,CAAC,SAAS,OAAO,EAAE,GAAG,GAAG,IACvB,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AAEvD,MAAM,MAAM,IAAI,CACd,CAAC,SAAS,KAAK,GAAG,GAAG,EACrB,CAAC,SAAS,MAAM,GAAG,GAAG,EACtB,CAAC,SAAS,OAAO,EAAE,GAAG,GAAG,IACvB,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;AAEtC,yBAAiB,IAAI,CAAC;IACpB,SAAgB,OAAO,CAAC,CAAC,SAAS,KAAK,EAAE,CAAC,SAAS,MAAM,EACvD,IAAI,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACf,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAanB;CACF"}
@@ -0,0 +1,23 @@
1
+ import * as G from "../util/generator/collect.js";
2
+ export var Call;
3
+ (function (Call) {
4
+ function collect(call) {
5
+ if (typeof call === "function") {
6
+ const maybeGen = call();
7
+ if (typeof maybeGen === "object" && Symbol.iterator in maybeGen) {
8
+ return G.collect(maybeGen);
9
+ }
10
+ else {
11
+ return [[], maybeGen];
12
+ }
13
+ }
14
+ else if (typeof call === "object" && Symbol.iterator in call) {
15
+ return G.collect(call);
16
+ }
17
+ else {
18
+ return [[], call];
19
+ }
20
+ }
21
+ Call.collect = collect;
22
+ })(Call || (Call = {}));
23
+ //# sourceMappingURL=Call.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Call.js","sourceRoot":"","sources":["../../src/core/Call.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAA;AAoBjD,MAAM,KAAW,IAAI,CAiBpB;AAjBD,WAAiB,IAAI;IACnB,SAAgB,OAAO,CACrB,IAAgB;QAEhB,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,CAAC;YAC/B,MAAM,QAAQ,GAAG,IAAI,EAAE,CAAA;YACvB,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,IAAI,QAAQ,EAAE,CAAC;gBAChE,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;YAC5B,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAA;YACvB,CAAC;QACH,CAAC;aAAM,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC;YAC/D,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QACxB,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,EAAE,EAAE,IAAI,CAAC,CAAA;QACnB,CAAC;IACH,CAAC;IAfe,YAAO,UAetB,CAAA;AACH,CAAC,EAjBgB,IAAI,KAAJ,IAAI,QAiBpB"}
@@ -0,0 +1,20 @@
1
+ import { Flatten } from "../util/Flatten.js";
2
+ import { GenCall, Result, ValueCall, Yield } from "./Call.js";
3
+ import { Factory, Type } from "./Type.js";
4
+ import { ExtractUse, Use } from "./Use.js";
5
+ export declare abstract class Effect<Y extends Yield, R extends Result> implements Generator<Y, R> {
6
+ yields?: Y[];
7
+ result?: R;
8
+ map<R2 extends Result>(_f: (value: R) => R2): Effect<Y, R2>;
9
+ next(): IteratorResult<Y, R>;
10
+ return(): IteratorResult<Y, R>;
11
+ throw(): IteratorResult<Y, R>;
12
+ [Symbol.iterator](): Generator<Y, R>;
13
+ "?"<M extends Factory<Exclude<R, void>>>(match: M): Effect<Y | InstanceType<M>, Exclude<R, InstanceType<M>>>;
14
+ "?"<M extends Factory<Exclude<R, void>>, W extends Type>(match: M, with_: W): Effect<Y | W, Exclude<R, InstanceType<M>>>;
15
+ handle<M extends Factory<Y>, R extends Result>(match: M, f: ValueCall<R, [value: InstanceType<M>]>): [Exclude<Y, InstanceType<M>>] extends [never] ? R : Effect<Exclude<Y, InstanceType<M>>, R>;
16
+ handle<M extends Factory<Y>, Y2 extends Yield, R extends Result>(match: M, f: GenCall<Y2, R, [value: InstanceType<M>]>): [Exclude<Y, InstanceType<M>> | Y2] extends [never] ? R : Effect<Exclude<Y, InstanceType<M>> | Y2, R>;
17
+ rehandle<M extends Factory[]>(..._match: M): [Exclude<Y, InstanceType<M[number]>>] extends [never] ? Extract<Y, InstanceType<M[number]>> | R : Effect<Exclude<Y, InstanceType<M[number]>>, R>;
18
+ }
19
+ export declare function call<Y extends Yield, R extends Result, D extends ExtractUse<Y>, A extends Partial<D>, N extends Omit<D, keyof A>>(_call: Generator<Y, R> | (() => Generator<Y, R>), _uses: A): Effect<Exclude<Y, Use> | [keyof N] extends [never] ? never : Use<Flatten<N>>, R>;
20
+ //# sourceMappingURL=Effect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Effect.d.ts","sourceRoot":"","sources":["../../src/core/Effect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,WAAW,CAAA;AAC7D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE1C,8BAAsB,MAAM,CAAC,CAAC,SAAS,KAAK,EAAE,CAAC,SAAS,MAAM,CAAE,YAAW,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;IAChF,MAAM,CAAC,EAAE,CAAC,EAAE,CAAA;IACZ,MAAM,CAAC,EAAE,CAAC,CAAA;IAElB,GAAG,CAAC,EAAE,SAAS,MAAM,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,GAAG,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC;IAI3D,IAAI,IAAI,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC;IAI5B,MAAM,IAAI,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC;IAI9B,KAAK,IAAI,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC;IAI5B,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,SAAS,C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AC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,GACrD,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAK/C,QAAQ,CAAC,CAAC,SAAS,OAAO,EAAE,EAC1B,GAAG,MAAM,EAAE,CAAC,GACX,CAAC,OAAO,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,GAC9F,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;CAInD;AAED,wBAAgB,IAAI,CAClB,CAAC,SAAS,KAAK,EACf,CAAC,SAAS,MAAM,EAChB,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,EACvB,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,EACpB,CAAC,SAAS,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAE1B,KAAK,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAChD,KAAK,EAAE,CAAC,GACP,MAAM,CACP,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EACrE,CAAC,CACF,CAEA"}
@@ -0,0 +1,37 @@
1
+ import { unimplemented } from "../util/unimplemented.js";
2
+ export class Effect {
3
+ map(_f) {
4
+ unimplemented();
5
+ }
6
+ next() {
7
+ unimplemented();
8
+ }
9
+ return() {
10
+ unimplemented();
11
+ }
12
+ throw() {
13
+ unimplemented();
14
+ }
15
+ *[Symbol.iterator]() {
16
+ while (this.yields?.length) {
17
+ yield this.yields.shift();
18
+ }
19
+ delete this.yields;
20
+ const result = this.result;
21
+ delete this.result;
22
+ return result;
23
+ }
24
+ "?"(_match, _maybeWith_) {
25
+ return unimplemented();
26
+ }
27
+ handle(_match, _f) {
28
+ unimplemented();
29
+ }
30
+ rehandle(..._match) {
31
+ unimplemented();
32
+ }
33
+ }
34
+ export function call(_call, _uses) {
35
+ unimplemented();
36
+ }
37
+ //# sourceMappingURL=Effect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Effect.js","sourceRoot":"","sources":["../../src/core/Effect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAKxD,MAAM,OAAgB,MAAM;IAI1B,GAAG,CAAoB,EAAoB;QACzC,aAAa,EAAE,CAAA;IACjB,CAAC;IAED,IAAI;QACF,aAAa,EAAE,CAAA;IACjB,CAAC;IAED,MAAM;QACJ,aAAa,EAAE,CAAA;IACjB,CAAC;IAED,KAAK;QACH,aAAa,EAAE,CAAA;IACjB,CAAC;IAED,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;QAChB,OAAO,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;YAC3B,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAG,CAAA;QAC5B,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAA;QAClB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAO,CAAA;QAC3B,OAAO,IAAI,CAAC,MAAM,CAAA;QAClB,OAAO,MAAM,CAAA;IACf,CAAC;IASD,GAAG,CACD,MAAiC,EACjC,WAAkB;QAElB,OAAO,aAAa,EAAE,CAAA;IACxB,CAAC;IAWD,MAAM,CAAC,MAAW,EAAE,EAAO;QACzB,aAAa,EAAE,CAAA;IACjB,CAAC;IAED,QAAQ,CACN,GAAG,MAAS;QAIZ,aAAa,EAAE,CAAA;IACjB,CAAC;CACF;AAED,MAAM,UAAU,IAAI,CAOlB,KAAgD,EAChD,KAAQ;IAKR,aAAa,EAAE,CAAA;AACjB,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { Factory, Type } from "./Type.js";
2
+ export declare function Hash<T extends Type, A extends HashAlgorithm>(targetType: Factory<T>, algorithm: A): {
3
+ new (source: import("./Type.js").TypeSource): {
4
+ targetType: Factory<T>;
5
+ algorithm: A;
6
+ ""?: [Uint8Array, never, never] | undefined;
7
+ readonly typeName: "Hash";
8
+ readonly source: import("./Type.js").TypeSource;
9
+ ctor: new (source: import("./Type.js").TypeSource) => any;
10
+ into<O extends never>(into: Factory<O>): O;
11
+ equals<T extends Type<any, any, any, any, any>>(this: T, inQuestion: T): import("./Bool.js").bool;
12
+ is<T_1 extends Type<any, any, any, any, any>, M extends Factory<T_1>>(this: T_1, match: M): import("./Bool.js").bool;
13
+ case<T_2 extends Type<any, any, any, any, any>, M_1 extends Factory<T_2>, R extends import("./Call.js").Result, U extends R | Exclude<T_2, InstanceType<M_1>>>(this: T_2, match: M_1, f: import("./Call.js").ValueCall<R, [InstanceType<M_1>]>): U;
14
+ case<T_3 extends Type<any, any, any, any, any>, M_2 extends Factory<T_3>, Y extends import("./Call.js").Yield, R_1 extends import("./Call.js").Result, U_1 extends R_1 | Exclude<T_3, InstanceType<M_2>>>(this: T_3, match: M_2, f: import("./Call.js").GenCall<Y, R_1, [InstanceType<M_2>]>): import("./Effect.js").Effect<Y, U_1>;
15
+ "?"<T_4 extends Type<any, any, any, any, any>, M_3 extends Factory<T_4>>(this: T_4, match: M_3): import("./Effect.js").Effect<InstanceType<M_3>, Exclude<T_4, InstanceType<M_3>>>;
16
+ "?"<T_5 extends Type<any, any, any, any, any>, M_4 extends Factory<T_5>, W extends Type<any, any, any, any, any>>(this: T_5, match: M_4, with_: W): import("./Effect.js").Effect<W, Exclude<T_5, InstanceType<M_4>>>;
17
+ };
18
+ make<Name extends string>(name: Name): {
19
+ new <Source, Native = never, From = Native, Into extends Type<any, any, any, any, any> = never>(source: Source | import("./Type.js").TypeSource): {
20
+ ""?: [Native, From, Into] | undefined;
21
+ readonly typeName: Name;
22
+ readonly source: Source | import("./Type.js").TypeSource;
23
+ ctor: new (source: Source | import("./Type.js").TypeSource) => any;
24
+ into<O_1 extends Into>(into: Factory<O_1>): O_1;
25
+ equals<T_6 extends Type<any, any, any, any, any>>(this: T_6, inQuestion: T_6): import("./Bool.js").bool;
26
+ is<T_7 extends Type<any, any, any, any, any>, M_5 extends Factory<T_7>>(this: T_7, match: M_5): import("./Bool.js").bool;
27
+ case<T_8 extends Type<any, any, any, any, any>, M_6 extends Factory<T_8>, R_2 extends import("./Call.js").Result, U_2 extends R_2 | Exclude<T_8, InstanceType<M_6>>>(this: T_8, match: M_6, f: import("./Call.js").ValueCall<R_2, [InstanceType<M_6>]>): U_2;
28
+ case<T_9 extends Type<any, any, any, any, any>, M_7 extends Factory<T_9>, Y_1 extends import("./Call.js").Yield, R_3 extends import("./Call.js").Result, U_3 extends R_3 | Exclude<T_9, InstanceType<M_7>>>(this: T_9, match: M_7, f: import("./Call.js").GenCall<Y_1, R_3, [InstanceType<M_7>]>): import("./Effect.js").Effect<Y_1, U_3>;
29
+ "?"<T_10 extends Type<any, any, any, any, any>, M_8 extends Factory<T_10>>(this: T_10, match: M_8): import("./Effect.js").Effect<InstanceType<M_8>, Exclude<T_10, InstanceType<M_8>>>;
30
+ "?"<T_11 extends Type<any, any, any, any, any>, M_9 extends Factory<T_11>, W_1 extends Type<any, any, any, any, any>>(this: T_11, match: M_9, with_: W_1): import("./Effect.js").Effect<W_1, Exclude<T_11, InstanceType<M_9>>>;
31
+ };
32
+ make<Name extends string>(name: Name): any;
33
+ "new"<T_12 extends Type<any, any, any, any, any>>(this: Factory<T_12>, ...[value]: import("../util/Rest.js").Rest<Type.From<T_12>>): T_12;
34
+ state<T_13 extends Type<any, any, any, any, any>>(this: Factory<T_13>): import("./State.js").State<T_13>;
35
+ };
36
+ "new"<T_12 extends Type<any, any, any, any, any>>(this: Factory<T_12>, ...[value]: import("../util/Rest.js").Rest<Type.From<T_12>>): T_12;
37
+ state<T_13 extends Type<any, any, any, any, any>>(this: Factory<T_13>): import("./State.js").State<T_13>;
38
+ };
39
+ export type HashAlgorithm = "Keccak256" | "Keccak384" | "Keccak512" | "Poseidon" | "SHA2_256" | "SHA3_256" | "SHA3_384" | "SHA3_512";
40
+ export type HashSource = never;
41
+ //# sourceMappingURL=Hash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Hash.d.ts","sourceRoot":"","sources":["../../src/core/Hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEzC,wBAAgB,IAAI,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC,SAAS,aAAa,EAC1D,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC,EACtB,SAAS,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMb;AAED,MAAM,MAAM,aAAa,GACrB,WAAW,GACX,WAAW,GACX,WAAW,GACX,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,CAAA;AAEd,MAAM,MAAM,UAAU,GAAG,KAAK,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { Type } from "./Type.js";
2
+ export function Hash(targetType, algorithm) {
3
+ return class extends Type.make("Hash") {
4
+ targetType = targetType;
5
+ algorithm = algorithm;
6
+ };
7
+ }
8
+ //# sourceMappingURL=Hash.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Hash.js","sourceRoot":"","sources":["../../src/core/Hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,IAAI,EAAE,MAAM,WAAW,CAAA;AAEzC,MAAM,UAAU,IAAI,CAClB,UAAsB,EACtB,SAAY;IAEZ,OAAO,KAAM,SAAQ,IAAI,CAAC,IAAI,CAAC,MAAM,CAAuC;QAC1E,UAAU,GAAG,UAAU,CAAA;QACvB,SAAS,GAAG,SAAS,CAAA;KACtB,CAAA;AACH,CAAC"}