lawspec 0.7.0 → 0.9.0

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.
package/build.json CHANGED
@@ -1,26 +1,112 @@
1
1
  {
2
2
  "version": 1,
3
3
  "compilerSources": [
4
+ "lawspec.cabal",
4
5
  "package.yaml",
6
+ "runtime/LawSpecCodecs.hs",
7
+ "runtime/LawSpecDataStrategies.hs",
8
+ "runtime/LawSpecDataStrategies.java",
9
+ "runtime/LawSpecKotlin.kt",
10
+ "runtime/LawSpecKotlinCodecs.kt",
11
+ "runtime/LawSpecKotlinStrategies.kt",
5
12
  "runtime/LawSpecRuntime.hs",
6
13
  "runtime/LawSpecRuntime.java",
14
+ "runtime/LawSpecSchema.hs",
15
+ "runtime/LawSpecSchema.java",
16
+ "runtime/LawSpecStrategies.kt",
17
+ "runtime/lawspec_codecs.go",
18
+ "runtime/lawspec_data_strategies.go",
19
+ "runtime/lawspec_data_strategies.mjs",
20
+ "runtime/lawspec_data_strategies.py",
7
21
  "runtime/lawspec_runtime.go",
8
22
  "runtime/lawspec_runtime.mjs",
9
23
  "runtime/lawspec_runtime.py",
24
+ "runtime/lawspec_runtime.rs",
25
+ "runtime/lawspec_schema.go",
26
+ "runtime/lawspec_schema.mjs",
27
+ "runtime/lawspec_schema.py",
28
+ "runtime/lawspec_strategies.rs",
29
+ "runtime/rust/Cargo.lock",
30
+ "runtime/rust/Cargo.toml",
10
31
  "src/LawSpec/Api.hs",
32
+ "src/LawSpec/Backend.hs",
33
+ "src/LawSpec/Capabilities.hs",
34
+ "src/LawSpec/Code/Doc.hs",
35
+ "src/LawSpec/Code/JavaScript.hs",
36
+ "src/LawSpec/Common.hs",
11
37
  "src/LawSpec/Compile.hs",
38
+ "src/LawSpec/Core.hs",
39
+ "src/LawSpec/Core/DefinitionContracts.hs",
40
+ "src/LawSpec/Core/Definitions.hs",
41
+ "src/LawSpec/Core/Eval.hs",
42
+ "src/LawSpec/Core/Expression.hs",
43
+ "src/LawSpec/Core/Payload.hs",
44
+ "src/LawSpec/Core/PayloadPlan.hs",
45
+ "src/LawSpec/Core/RefinementProof.hs",
46
+ "src/LawSpec/Core/Schema.hs",
47
+ "src/LawSpec/Core/Semantics.hs",
48
+ "src/LawSpec/Core/Total.hs",
49
+ "src/LawSpec/Core/Totality.hs",
50
+ "src/LawSpec/Core/Types.hs",
51
+ "src/LawSpec/Core/Validate.hs",
52
+ "src/LawSpec/Core/Value.hs",
53
+ "src/LawSpec/CoreEmit.hs",
54
+ "src/LawSpec/CoreNativeScalarEmit.hs",
55
+ "src/LawSpec/CoreScalarEmit.hs",
56
+ "src/LawSpec/Data.hs",
57
+ "src/LawSpec/DefinitionTotality.hs",
12
58
  "src/LawSpec/Domain.hs",
59
+ "src/LawSpec/Elaboration.hs",
13
60
  "src/LawSpec/Emit.hs",
14
61
  "src/LawSpec/Eval.hs",
62
+ "src/LawSpec/Frontend.hs",
15
63
  "src/LawSpec/Gen.hs",
64
+ "src/LawSpec/GoData.hs",
65
+ "src/LawSpec/GoDefinitions.hs",
66
+ "src/LawSpec/GoExpr.hs",
67
+ "src/LawSpec/GoProperties.hs",
68
+ "src/LawSpec/GoTestHelpers.hs",
69
+ "src/LawSpec/GoTypeRefs.hs",
70
+ "src/LawSpec/HaskellData.hs",
71
+ "src/LawSpec/HaskellDefinitions.hs",
72
+ "src/LawSpec/HaskellExpr.hs",
73
+ "src/LawSpec/HaskellProperties.hs",
74
+ "src/LawSpec/HaskellTestHelpers.hs",
75
+ "src/LawSpec/HaskellTypeRefs.hs",
76
+ "src/LawSpec/Inference.hs",
77
+ "src/LawSpec/JavaData.hs",
78
+ "src/LawSpec/JavaDefinitions.hs",
79
+ "src/LawSpec/JavaExpr.hs",
80
+ "src/LawSpec/JavaProperties.hs",
81
+ "src/LawSpec/JavaTestHelpers.hs",
82
+ "src/LawSpec/KotlinData.hs",
83
+ "src/LawSpec/KotlinDefinitions.hs",
84
+ "src/LawSpec/KotlinExpr.hs",
85
+ "src/LawSpec/KotlinProperties.hs",
86
+ "src/LawSpec/KotlinTestHelpers.hs",
16
87
  "src/LawSpec/Model.hs",
17
- "src/LawSpec/NativeScalarEmit.hs",
18
88
  "src/LawSpec/Parser.hs",
89
+ "src/LawSpec/PortableGenerator.hs",
90
+ "src/LawSpec/PortableTestHelpers.hs",
19
91
  "src/LawSpec/Prelude.hs",
92
+ "src/LawSpec/Public.hs",
93
+ "src/LawSpec/PythonData.hs",
94
+ "src/LawSpec/PythonDefinitions.hs",
95
+ "src/LawSpec/PythonExpr.hs",
96
+ "src/LawSpec/PythonTypes.hs",
20
97
  "src/LawSpec/Refinement.hs",
21
98
  "src/LawSpec/RuntimeSources.hs",
99
+ "src/LawSpec/RustData.hs",
100
+ "src/LawSpec/RustDefinitions.hs",
101
+ "src/LawSpec/RustEmit.hs",
102
+ "src/LawSpec/RustExpr.hs",
22
103
  "src/LawSpec/Scalar.hs",
23
- "src/LawSpec/ScalarEmit.hs",
104
+ "src/LawSpec/SpecializeDefinitions.hs",
105
+ "src/LawSpec/Testing.hs",
106
+ "src/LawSpec/WebData.hs",
107
+ "src/LawSpec/WebDefinitions.hs",
108
+ "src/LawSpec/WebExpr.hs",
109
+ "src/LawSpec/WebTypes.hs",
24
110
  "stack.yaml",
25
111
  "stack.yaml.lock",
26
112
  "tools/embed-runtimes.py",
@@ -30,36 +116,122 @@
30
116
  "wasm/lawspec-wasm.cabal"
31
117
  ],
32
118
  "digests": {
33
- "package.yaml": "ca15186d8aa807c58258a4b0fef8fa7d64afaa828f2e71803b4e8741066422fe",
34
- "runtime/LawSpecRuntime.hs": "1c3ca22232c64227717d836a57d375d906f748ecde6b79705944a2319ce5064d",
35
- "runtime/LawSpecRuntime.java": "5637914bd491f75ad0c75fb19d1bec798164295b7bcf9d23e1549e8ebf780d01",
36
- "runtime/lawspec_runtime.go": "62d2041c33760b67db619e0a803501768a505c4dfd9837bca85e158fff81fda9",
37
- "runtime/lawspec_runtime.mjs": "7d0abd53fa45dd9828c10ff2ffa7876162e965e7bb4913f4c460af13e06142fa",
38
- "runtime/lawspec_runtime.py": "7541353effebd133e50cd00a3f4d8999651c93ba751a6d951164b1f390ce0c15",
39
- "src/LawSpec/Api.hs": "f1a283fd3696e8e0dd1bd6240ba636a4c1abe19c6e0ea25d6d80a1af89f762cb",
40
- "src/LawSpec/Compile.hs": "a67ee7cb19ebeea644bbf8dbdc0647323a77197b15f8e87fe2227deb6c995b8e",
41
- "src/LawSpec/Domain.hs": "8ad50ad3a37aacb3a429c2d7924279e2a3b973204ce3c5c04c634c1b9ada0151",
42
- "src/LawSpec/Emit.hs": "0b29d449f762af635bb65e5fcbf1f4cfffb1b91b28db115b08b2309557498693",
43
- "src/LawSpec/Eval.hs": "9bdb694352ec4bd7140cdf8ab18045978b7407e93db5b661270160d08e4e9b7d",
44
- "src/LawSpec/Gen.hs": "d4b4e5a21f5a2886dcdc98f56f649980d961c0570d9463154bed459844ab66aa",
45
- "src/LawSpec/Model.hs": "67cad75f1d344bc2dfc997731c37f68994c6a6b568e03209e5b446484ae54674",
46
- "src/LawSpec/NativeScalarEmit.hs": "67f50a7ea381ddada8ecbfc7534917c53f4074f8ce1d4fb6948adb8b7dfb2007",
47
- "src/LawSpec/Parser.hs": "b6e5ee4a8c58b0ab2709420460f1fcabe287714f6defc0fab6cf52ccd0c416a5",
119
+ "lawspec.cabal": "f3372cb64f48514e0e7b16c2ea95636845cdd817b8231e23283b5af8d988fca2",
120
+ "package.yaml": "6f039e41854347b0443378de9b163e541e7f4b77448c8f620199a60d36bafcca",
121
+ "runtime/LawSpecCodecs.hs": "90cb1ed15d7ab664a17a054580c849408d77cfd2b2adcb4a3228b05132caeaca",
122
+ "runtime/LawSpecDataStrategies.hs": "840a316e1a69a862957bbd0f799440fc434240c156a3398e5be6563ecaa70a1b",
123
+ "runtime/LawSpecDataStrategies.java": "7e87c952ed192bf93a4b40f251a097148b7387ce7d505b5bc893cd9d51af3e65",
124
+ "runtime/LawSpecKotlin.kt": "0cf3b7de0406155225ccca33ee3dfdf8f0456c47d577f6be8f1265c13df838cb",
125
+ "runtime/LawSpecKotlinCodecs.kt": "6210f77dbbe24ba2088db48dae5415abf0993fe552fb3a57d29430807efbc297",
126
+ "runtime/LawSpecKotlinStrategies.kt": "2841edc3595f6d291859cc7edd31ea52093acf86d3542f07575784b01f9de237",
127
+ "runtime/LawSpecRuntime.hs": "5ced6a6a86a892ae63a544d4c4a4429bf756a730ea786478d820c8070cc96402",
128
+ "runtime/LawSpecRuntime.java": "c7b7cfc9b7c22b082edee14a52d95ef80ebe01ee56988c22702f629ea24b8a4f",
129
+ "runtime/LawSpecSchema.hs": "9912d9f525426a598f9c03c29cfc7bacf80218f73c9d537d8c1257bae245aa33",
130
+ "runtime/LawSpecSchema.java": "885f5f17a9ea1bdb86915dc184aea25b72c3062d6ddb9605530310540b1cc166",
131
+ "runtime/LawSpecStrategies.kt": "569f7775c0ac44765d05567cbf62d026558ac193c080ca71681ec6ee49c21794",
132
+ "runtime/lawspec_codecs.go": "abc910b8ea65f503b2df2c236250b5398012fe5eaf30f3e91d968e34c0897c1e",
133
+ "runtime/lawspec_data_strategies.go": "37aed9e49a286ea74ad9004c85e2ee4e780c99634735f0b40b0233ac24a41443",
134
+ "runtime/lawspec_data_strategies.mjs": "b39db076de1fc4310633a5271a10b336c56d6b1778c6cd8c2bd937f69e87a97d",
135
+ "runtime/lawspec_data_strategies.py": "542320b8733dea4cef96efcbc0ed65a949a90ca94b1771b0bee5773d06740e9a",
136
+ "runtime/lawspec_runtime.go": "af6ef660387b625b3bb5fcd57f06260c821d4f65eda158db44ad12d66e1d70f8",
137
+ "runtime/lawspec_runtime.mjs": "3b7877c1ee523afba30ed24cd452e2a6126d9e741c7675600e867600d7a73f46",
138
+ "runtime/lawspec_runtime.py": "2f780bc92762eb1115f734a36cc224ae34504929b4ff0ec506735cfa9e3ab02b",
139
+ "runtime/lawspec_runtime.rs": "7ae8afaad638a3d9d6973eebc7cd6daecc8012ec57f3f12ff50cca16e23e15b6",
140
+ "runtime/lawspec_schema.go": "bdfb6f2552bfccf56073d52f7cdbe1d784cba2d956c29762d77df7ad6bba8d67",
141
+ "runtime/lawspec_schema.mjs": "d204852d89aa862fc980225c111064e7c41bce5873c08063472b3da66190530c",
142
+ "runtime/lawspec_schema.py": "bf5c719caec1a91c5720be140ceec2cd01a6a2e0cb9a89c7a9bb05fdeecb34e7",
143
+ "runtime/lawspec_strategies.rs": "74c7b58e5ae119c226cec15b5f12875ba3647e45d4868086543ead6fed3bcc3d",
144
+ "runtime/rust/Cargo.lock": "dd5a3c0ba85579d13e61040334e9b16866124d2e88754948ec7dd512ade026ca",
145
+ "runtime/rust/Cargo.toml": "4bd3bb457970bf8f7af8531fc45fd6b605f995594a3ee0f60f7f1aaf765bb8aa",
146
+ "src/LawSpec/Api.hs": "532960f438214b4ca8a43d8d60777b6086e323f0c54fc7d1bc6bdbf0592ea319",
147
+ "src/LawSpec/Backend.hs": "03c3b0cd62467ca677c88d29d7b12b2ab505cc0076d93d1f48fbddb0e9bcf133",
148
+ "src/LawSpec/Capabilities.hs": "e43d4fc3a4481fbb8aa3ff1c3f41f7e7fca5db01bfe256a30162a45d75a00c1c",
149
+ "src/LawSpec/Code/Doc.hs": "9e3b70f85deb1dcbce385af1d0cd4bea2dfa8a2d806d54745d4bb437406673e5",
150
+ "src/LawSpec/Code/JavaScript.hs": "77bf27dcc210216e4739f68c4709f556f80130ab83b3b9387ac4a2421e790910",
151
+ "src/LawSpec/Common.hs": "107612a8aaa787488413acf9c1a56622004d3bff251db89b99928343e6070883",
152
+ "src/LawSpec/Compile.hs": "0260f0f1dc3d18d2f2e172ab47d603b6e3029ce2948cc0a237ad8277fc64707f",
153
+ "src/LawSpec/Core.hs": "ec081c49e5ccce95f84ded6073f1d8f30298f061dd8b94437d4b00410c57f27c",
154
+ "src/LawSpec/Core/DefinitionContracts.hs": "b7f60f038b231187ecf898e585ae1a8fb1fc113bb55bad6d1bb2660350fd969e",
155
+ "src/LawSpec/Core/Definitions.hs": "52f024fca59661142f70f9aa7dd2cbdb4892e5d3b1ca8079c878c5a1ba667112",
156
+ "src/LawSpec/Core/Eval.hs": "e1ad8af5b240dd99c3b1126408d2be5f9b42b86ca6189ecd3868680a5119d931",
157
+ "src/LawSpec/Core/Expression.hs": "84985f4f685126253d3af7b6b605d80d28fc9aa115bd5e2946f989eeb1355224",
158
+ "src/LawSpec/Core/Payload.hs": "df6a2b250c27c12bb6ac16b84847c52546081d066a3dca7575ed0d743cc13d50",
159
+ "src/LawSpec/Core/PayloadPlan.hs": "f2a7d2dc58c6a0f79707bdc24773bd3aad3a3b8eea2735a8284b2a9f3a4af4a8",
160
+ "src/LawSpec/Core/RefinementProof.hs": "c19fc03e68488357a59897ec38ce3d2efd320c35b405b632af17425d6a18447a",
161
+ "src/LawSpec/Core/Schema.hs": "9a4ec3967803913e6ff43d33e00a1b4b3b8ec0c79dbdbd80ae98101c85bf430f",
162
+ "src/LawSpec/Core/Semantics.hs": "a9d019433e3b9731f8cd0f65ec0ccc53179824bea58247b72df26760b878c2b6",
163
+ "src/LawSpec/Core/Total.hs": "95d2b19ba7fbfd033295504d31f786815384003b3b4d370776860b423cf079dd",
164
+ "src/LawSpec/Core/Totality.hs": "8f5b5d69f4baaba45301899ef568cbe90133943c3771ba78d492424e9725e7a7",
165
+ "src/LawSpec/Core/Types.hs": "4adf656d17812b68e8bf2d541908c769772cd5bfc9ac7a6c367160a5c40c9212",
166
+ "src/LawSpec/Core/Validate.hs": "0f045241215e068081d6cd7cf451f0166671bae5fffafda71a2e2320e8014c27",
167
+ "src/LawSpec/Core/Value.hs": "f2b2e4d82491e184d60b1217922b25c57a06cbbaecb2cb6f31174af50268fbc9",
168
+ "src/LawSpec/CoreEmit.hs": "868633c03239f12543a357677a273896839a0c044f402477a998b9299557c9cd",
169
+ "src/LawSpec/CoreNativeScalarEmit.hs": "43f1a22e95539b717a4a9c50b159d6b0b3879278fc90992a40dba4503f614c94",
170
+ "src/LawSpec/CoreScalarEmit.hs": "485e51dbe3f4dd2f23fb586737364f83e4af98ab532a1462c8b8451fefdb69ed",
171
+ "src/LawSpec/Data.hs": "9dbeafa120276b114dad790ec69e617f7ad0c632e3c718962f2f7faf8ca327f4",
172
+ "src/LawSpec/DefinitionTotality.hs": "7671b7efb0cac5d796b074d48b2c10940e5bd0b5df082b926aee694903285efa",
173
+ "src/LawSpec/Domain.hs": "222d15f0012ae630802238a6d7e1ee78d1e718b599f5ebb5a1ddc4e8d29d68c3",
174
+ "src/LawSpec/Elaboration.hs": "86e3ef77a977cb1b55985e2939648135acd0c2c015afe76e34e09615d555f53e",
175
+ "src/LawSpec/Emit.hs": "9f34f5765915a2a12a66a6dca647ddaef9289372956802c6d99cf0cfec447c7a",
176
+ "src/LawSpec/Eval.hs": "b0872ba8a6974463b32776653c2939826a6be87318c15641401f913f6b139de2",
177
+ "src/LawSpec/Frontend.hs": "fbf091b9c96f5b5361dbf4f65819634c0f8526ff98550d97c434c0d47af7839e",
178
+ "src/LawSpec/Gen.hs": "0410d4db3727a7999bc08a581301eb71ab570671e0ebeef7f1570ff76152b0a7",
179
+ "src/LawSpec/GoData.hs": "813770986acac02846e446e02e72f634b328c2c23c083fd3bfafbe236524e8a2",
180
+ "src/LawSpec/GoDefinitions.hs": "09e9e4b60cfea893d35589cd18bc8a6099789d81e0f57ae5cb018bd95bd4838b",
181
+ "src/LawSpec/GoExpr.hs": "da3a7cc0e3d2906886dc44f6b990e72098bb351558bbb31ee335da7382fac58a",
182
+ "src/LawSpec/GoProperties.hs": "c0bbbba3b6d15b14c28095dd5c6f35d30aa70fd5991fe95d6f6642d0f69b1d42",
183
+ "src/LawSpec/GoTestHelpers.hs": "dee55ee8505370e932773b8c685f4a1f380129e6f43f8806bf1e82efb99451b1",
184
+ "src/LawSpec/GoTypeRefs.hs": "7f239f5ac3ac8bd21c8f76c328049f7715d8562ee1382befa0a58abd4f15f726",
185
+ "src/LawSpec/HaskellData.hs": "125d5b8331d4e0a737f5de2fc28cf01677ba7e275b59238416eafdb9b973c809",
186
+ "src/LawSpec/HaskellDefinitions.hs": "535a8d644d5ddb98c22fa6bdf34cf2baa787aa1f5b900815c621d0d65ede0f0f",
187
+ "src/LawSpec/HaskellExpr.hs": "f4144cf2022ef0a3bec6d796ebe7d2f42563e9d25758b9f362cd5545b47e802b",
188
+ "src/LawSpec/HaskellProperties.hs": "770b5047ec35e99ce186b65f22d913e0e117f33a3103d5382176ccf4ec50393a",
189
+ "src/LawSpec/HaskellTestHelpers.hs": "51e59b2abc9e85455e3c8e2c6baadb27e5d319081cb730d2ce56be5dc8053897",
190
+ "src/LawSpec/HaskellTypeRefs.hs": "2225b2a5e2ab3662e7202d23b24f4d6db48353b35ae28df8acd2b92fd2b97574",
191
+ "src/LawSpec/Inference.hs": "78285145897f03c3c4adc37acf0f490ea779bab3975fb2830628dae3a152fe38",
192
+ "src/LawSpec/JavaData.hs": "8f5720812a899e02f7d607a7acef133b7aec4a7617e597700a87e436604e0563",
193
+ "src/LawSpec/JavaDefinitions.hs": "9c0fe11bd4849af09bbe3d941d89ba609a2dabecdc1c8b09b6ddbf69671c8f92",
194
+ "src/LawSpec/JavaExpr.hs": "6f237b0fc1eabe2d53c160f4cb781f8b77b478383f1a77ca4ccc8f08ac0dbcd0",
195
+ "src/LawSpec/JavaProperties.hs": "6cacfc6a005ac93a684e94efbfa7f83619d8658a396722b3fc47e533ba04cac1",
196
+ "src/LawSpec/JavaTestHelpers.hs": "e6f4b9bbb7e5f07ece6ab1845e12aa661e62e8b926680b11454223fc3ec1523d",
197
+ "src/LawSpec/KotlinData.hs": "338f576204e1f30cc0fdf82c806cbffcfbed3a5dfd1b33ac91cde7d975a28360",
198
+ "src/LawSpec/KotlinDefinitions.hs": "97d7d407d4bbdb4ce16035d607dbbcb8e3d6f5db513f2123a2c269e3dc6d2b38",
199
+ "src/LawSpec/KotlinExpr.hs": "20312f0774f1d0832a21a19b93c8103e2791ecd32a827d8e9c4f2b4830a996a0",
200
+ "src/LawSpec/KotlinProperties.hs": "670a5585a552a2ac91922938a859ca437c32fafd085517bdf2ee169b4d6129c2",
201
+ "src/LawSpec/KotlinTestHelpers.hs": "74810d65faafc6ed4d64b1fb0596cda4186e586b7144a7441641b798795bc324",
202
+ "src/LawSpec/Model.hs": "1d7ceb7bd66e3d496eef89eaa86403e6896472317ca9a4be86e0c933a7cce403",
203
+ "src/LawSpec/Parser.hs": "ad11e8f06371e98f295fae0245edceac8142320f054d0c3cb5600bc72588e17e",
204
+ "src/LawSpec/PortableGenerator.hs": "69d457e39f539c77fc7a4c08205e75352bbecd9dfdff031a283a39bf44b22d49",
205
+ "src/LawSpec/PortableTestHelpers.hs": "8ba4d87183c8c11f6ef1ce21c170127335797154f29fb97ad3429f032a167fd3",
48
206
  "src/LawSpec/Prelude.hs": "b1e155c12f58e7c346551a0c65c5d5af76d045b3f1625977ca2a5d1c97cb8c46",
49
- "src/LawSpec/Refinement.hs": "060f7bdaaa9cebc17969fa28474e9402cc918ceea0f18cac54050d25010b473c",
50
- "src/LawSpec/RuntimeSources.hs": "4a49d98919971bdbe2b9eabda4eb2e7cda643aaa65ef1a4e6892b6da40ee8acd",
51
- "src/LawSpec/Scalar.hs": "d89d8233abd893f65bb20d4dabe11066340eb51b982ad6fa7bce04d3e22c3547",
52
- "src/LawSpec/ScalarEmit.hs": "e1f05d255db08c8634b6af98fd5d0b938f9a3735f8adf13a952f092a90ee884c",
207
+ "src/LawSpec/Public.hs": "1b5e6031983cdc81559faea8a9a7e9a7bfab835de90fbf8c89f26844c411563a",
208
+ "src/LawSpec/PythonData.hs": "07e9bb54a1515f3f4744b7b9bb43633cbdbf07b3f9e35efef511753f97e216d5",
209
+ "src/LawSpec/PythonDefinitions.hs": "bc7b971be97339f2d9e4962ad98100878266176aeccd2a9dfd014e2db9550bd8",
210
+ "src/LawSpec/PythonExpr.hs": "23d7d24b5fb4efff9cb63d38c02a93d95744ec79b4565daf1412088fc7c4ba59",
211
+ "src/LawSpec/PythonTypes.hs": "ef928bfeb4324eb6e53c99cae247cc2fa84816075d81de4589d14abaa326656a",
212
+ "src/LawSpec/Refinement.hs": "8058a9f7e433b4b00ef0966a9ea2be3c91ae93b591ed58a1ffcb792d316193d3",
213
+ "src/LawSpec/RuntimeSources.hs": "ca453784dd06b7be37568aa142e402fabf9a572d6144766fabf14677d77d95e8",
214
+ "src/LawSpec/RustData.hs": "08e2c1e2181cbe120362b9fe87881dc78aaa4878c7a7fcec46d1df086b658ae5",
215
+ "src/LawSpec/RustDefinitions.hs": "5d0328a8b17e0cb5067f65d23f0f2cd2a96b92e4b1c3d6e22b7cb08255697177",
216
+ "src/LawSpec/RustEmit.hs": "4fbbf0e81627d477fd42db380cd7ff067c4a8641a9e74957d93ba2f3b0dce79b",
217
+ "src/LawSpec/RustExpr.hs": "04b2ef81417b811c7b98a98acdadab4e588ca8757964a63ba8dc5936c36479e6",
218
+ "src/LawSpec/Scalar.hs": "52e61fec81a337bb5b35e9e6f501446cf0b18bffa6c6af2ddc5aeac2d6e07131",
219
+ "src/LawSpec/SpecializeDefinitions.hs": "08f2fe674a5e00d1be396d9edab0dd2c948b7beb12fa99f2a6aba00cbdf01e33",
220
+ "src/LawSpec/Testing.hs": "db1a427ac2197e447faf2a36eccfe965c58eaa0ba07bc494bf1ba24e4af43ad4",
221
+ "src/LawSpec/WebData.hs": "d32ed71cc09a5715b6fbaf2c5784afc939e2cb61db4b364f7bed98118fd63899",
222
+ "src/LawSpec/WebDefinitions.hs": "fd985db70c778c8014b780666ac327018e05260be610fa717b8c5477ba9638b4",
223
+ "src/LawSpec/WebExpr.hs": "0389dcd5cf7479dd23ef034b1012de6ebd70bf1dc9e3d90981dfb0ba2702596f",
224
+ "src/LawSpec/WebTypes.hs": "f77ffee1e0c7929964a889fb252c1c5d0977afed94664ffcb0f8770c37b98c70",
53
225
  "stack.yaml": "20ccf4d599e355e60b7aa4f814a7cd4299fe2048616cc2e6dbdc22a7bd8cec73",
54
226
  "stack.yaml.lock": "ae222b9c81af920c56e50fa4596fa57786e7fa5a7b461390362b2b2ff63818c7",
55
- "tools/embed-runtimes.py": "7520956a91f4b4ec8a6ab12078195cf1243c989b388a3f9d0b10a0fa60193bc3",
227
+ "tools/embed-runtimes.py": "91a05197fc542a65387f3ccf4614a4817c850031eb4b84196c621b8baf344865",
56
228
  "wasm/app/Exports.hs": "4ecbdac8faa2449e6fc61b93c82e6278fa14374154f29b4dacf0eef433f06a47",
57
229
  "wasm/cabal.project": "021e560afdc5eb4cb7169e7119ecb8f92c9ee170245af909c94b612941bff5cc",
58
230
  "wasm/cabal.project.freeze": "733dbed3d2ecccb26e874fd58f136296dad772184deb1658c196b5d54a0814dc",
59
- "wasm/lawspec-wasm.cabal": "afdb97eb4a08de190f7533b7be79c6ba11fab9ef30792aca71ef5fb448001106",
60
- "npm/core.wasm": "32e3f553dc8346a0d7aac63ad556eacc0e791803b8957f0804a609b883ed0ea8",
231
+ "wasm/lawspec-wasm.cabal": "61a21f9fc39087839a0df9781d94c9e7ed3dc375316c06e7dac36bd5e67e7f20",
232
+ "npm/core.wasm": "544ee4b0706f30b73ec6d4d1de1c27da7ebf9838c1dd1b9cff45b7c0393773da",
61
233
  "npm/core_jsffi.js": "88d136efe92f7cff5758c8fec8d9b6bbc9707fe37741cebeeb415fe34ce3d72b",
62
- "npm/api.mjs": "d6df654600172131ac66a55b86876fc29cde2a76a0a63bbefff3183488a4837b",
63
- "npm/index.d.ts": "ec19e731ed33e0d0481345888c73778ae0d3f2db58e4c3310ba684b801e698bc"
234
+ "npm/api.mjs": "6e25bb1f187d073f56badc1cd66c6c7f779cf68f1c5607d702d775c1c8b8a6dd",
235
+ "npm/index.d.ts": "d1348a783a116752c8ff2bf31fc29aab107b1452a516bd7b594153e3620cefcd"
64
236
  }
65
237
  }
@@ -2,37 +2,120 @@
2
2
  "version": 1,
3
3
  "targets": {
4
4
  "java": {
5
- "java": ["25", "26"],
6
- "jetCheck": ["0.3.0", "0.3.1"],
7
- "junit-jupiter": ["5.14.0", "5.15.0"]
5
+ "java": [
6
+ "25",
7
+ "26"
8
+ ],
9
+ "jetCheck": [
10
+ "0.3.0",
11
+ "0.3.1"
12
+ ],
13
+ "junit-jupiter": [
14
+ "5.14.0",
15
+ "5.15.0"
16
+ ]
8
17
  },
9
18
  "python": {
10
- "python": ["3.13", "3.15"],
11
- "pytest": ["8.4.0", "8.5.0"],
12
- "hypothesis": ["6.135.26", "7"]
19
+ "python": [
20
+ "3.13",
21
+ "3.15"
22
+ ],
23
+ "pytest": [
24
+ "8.4.0",
25
+ "8.5.0"
26
+ ],
27
+ "hypothesis": [
28
+ "6.135.26",
29
+ "7"
30
+ ]
13
31
  },
14
32
  "javascript": {
15
- "fast-check": ["4", "5"]
33
+ "fast-check": [
34
+ "4",
35
+ "5"
36
+ ]
16
37
  },
17
38
  "typescript": {
18
- "fast-check": ["4", "5"],
19
- "typescript": ["5.9", "5.10"],
20
- "@types/node": ["22", "23"]
39
+ "fast-check": [
40
+ "4",
41
+ "5"
42
+ ],
43
+ "typescript": [
44
+ "5.9",
45
+ "5.10"
46
+ ],
47
+ "@types/node": [
48
+ "22",
49
+ "23"
50
+ ]
21
51
  },
22
52
  "go": {
23
- "go": ["1.22", "1.27"],
24
- "rapid": ["1.2.0", "1.2.1"]
53
+ "go": [
54
+ "1.22",
55
+ "1.27"
56
+ ],
57
+ "rapid": [
58
+ "1.2.0",
59
+ "1.2.1"
60
+ ]
25
61
  },
26
62
  "haskell": {
27
- "hspec": ["2.11", "2.12"],
28
- "hedgehog": ["1.5", "1.6"],
29
- "hspec-hedgehog": ["0.3.0.0", "0.3.0.1"],
30
- "ghc": ["9.10", "9.11"]
63
+ "hspec": [
64
+ "2.11",
65
+ "2.12"
66
+ ],
67
+ "hedgehog": [
68
+ "1.5",
69
+ "1.6"
70
+ ],
71
+ "hspec-hedgehog": [
72
+ "0.3.0.0",
73
+ "0.3.0.1"
74
+ ],
75
+ "ghc": [
76
+ "9.10",
77
+ "9.11"
78
+ ]
31
79
  },
32
80
  "kotlin": {
33
- "java": ["25", "26"],
34
- "gradle": ["9.1", "9.4"],
35
- "kotlin": ["2.3.21", "2.3.22"]
81
+ "java": [
82
+ "25",
83
+ "26"
84
+ ],
85
+ "gradle": [
86
+ "9.1",
87
+ "9.4"
88
+ ],
89
+ "kotlin": [
90
+ "2.3.21",
91
+ "2.3.22"
92
+ ]
93
+ },
94
+ "rust": {
95
+ "rust": [
96
+ "1.85",
97
+ "2"
98
+ ],
99
+ "proptest": [
100
+ "1.11.0",
101
+ "1.11.1"
102
+ ],
103
+ "num-bigint": [
104
+ "0.4.8",
105
+ "0.4.9"
106
+ ],
107
+ "num-rational": [
108
+ "0.4.2",
109
+ "0.4.3"
110
+ ],
111
+ "num-complex": [
112
+ "0.4.6",
113
+ "0.4.7"
114
+ ],
115
+ "num-traits": [
116
+ "0.2.19",
117
+ "0.2.20"
118
+ ]
36
119
  }
37
120
  }
38
121
  }
package/core.wasm CHANGED
Binary file
package/doctor.mjs CHANGED
@@ -67,14 +67,14 @@ async function installed(req, name) {
67
67
  dir = parent;
68
68
  }
69
69
  }
70
- export async function doctor(target, root) {
70
+ export async function doctor(target, root, plannedArtifacts = []) {
71
71
  const name = target.language;
72
72
  const defaults =
73
73
  name === "java"
74
74
  ? ["src/main/java", "src/test/java"]
75
75
  : name === "kotlin"
76
76
  ? ["src/main/kotlin", "src/test/kotlin"]
77
- : ["src", name === "python" ? "tests" : "test"];
77
+ : ["src", ["python", "rust"].includes(name) ? "tests" : "test"];
78
78
  const sourceDir = target.sourceDir ?? defaults[0];
79
79
  const testDir = target.testDir ?? defaults[1];
80
80
  try {
@@ -257,6 +257,8 @@ export async function doctor(target, root) {
257
257
  "The Stack profile requires one package per target root",
258
258
  );
259
259
  const cabal = await readFile(path.join(root, cabals[0]), "utf8");
260
+ const components = cabal.split(/^(?:library(?:[ \t]+\S+)?|test-suite[ \t]+\S+)[ \t]*\n/m).slice(1).map(s => s.split(/\n(?=\S)/)[0]);
261
+ requireThat(components.some(s => s.includes(sourceDir) && ['text','bytestring'].every(dep => new RegExp(`(?:^|[\\s,])${dep}(?=[\\s,<>=]|$)`).test(s))), "The component compiling generated source must directly depend on text and bytestring");
260
262
  const suites = cabal
261
263
  .split(/^test-suite\s+/m)
262
264
  .slice(1)
@@ -355,6 +357,33 @@ export async function doctor(target, root) {
355
357
  ),
356
358
  "The JUnit Jupiter test engine must be on the test classpath",
357
359
  );
360
+ } else if (name === "rust") {
361
+ const compiler = target.rustc || "rustc";
362
+ const cargo = target.cargo || "cargo";
363
+ versions.rust = (await run(compiler, ["--version"], root)).match(/^rustc (\d+\.\d+\.\d+)/)?.[1];
364
+ requireThat(versions.rust && compare(versions.rust, "1.85.0") >= 0, "Rust 1.85+ is required");
365
+ const data = JSON.parse(await run(cargo, ["metadata", "--format-version", "1"], root));
366
+ const pkg = data.packages.find(p => path.resolve(p.manifest_path) === path.join(root, "Cargo.toml"));
367
+ requireThat(pkg, "Select a Cargo package directory containing Cargo.toml");
368
+ requireThat(pkg.edition === "2024", "Cargo package must use edition 2024");
369
+ const node = data.resolve.nodes.find(n => n.id === pkg.id);
370
+ for (const dep of ["proptest", "num-bigint", "num-rational", "num-complex", "num-traits"]) {
371
+ const reference = node.deps.find(d => d.name === dep.replaceAll("-", "_"));
372
+ versions[dep] = data.packages.find(p => p.id === reference?.pkg)?.version;
373
+ requireThat(versions[dep], `Missing direct Cargo dependency: ${dep}`);
374
+ }
375
+ const manifest = await readFile(path.join(root, "Cargo.toml"), "utf8");
376
+ requireThat(!/harness\s*=\s*false/.test(manifest), "Rust generated tests require the standard Cargo test harness");
377
+ const testRoot = path.resolve(root, testDir);
378
+ const expectedTests = plannedArtifacts.length
379
+ ? plannedArtifacts.filter(f => f.placement === "test" && f.path.endsWith("_lawspec.rs")).map(f => path.resolve(root, f.path))
380
+ : (await readdir(testRoot).catch(error => {if(error.code === "ENOENT") return []; throw error;})).filter(n => n.endsWith("_lawspec.rs")).map(n => path.join(testRoot,n));
381
+ if (testDir !== "tests" || /autotests\s*=\s*false/.test(manifest)) {
382
+ const registered = new Set(pkg.targets.filter(t => t.kind.includes("test") && t.test).map(t => path.resolve(t.src_path)));
383
+ requireThat(expectedTests.length ? expectedTests.every(file => registered.has(file)) : [...registered].some(file => file.startsWith(testRoot + path.sep)), "Register every generated Rust test file with Cargo [[test]] entries for this custom layout");
384
+ }
385
+ const library = pkg.targets.find(t => t.kind.includes("lib"));
386
+ requireThat(!library || path.dirname(path.resolve(library.src_path)) === path.resolve(root, sourceDir), "Cargo library path must match the configured sourceDir");
358
387
  } else if (name === "kotlin") {
359
388
  const command =
360
389
  target.gradle ||
@@ -1,13 +1,13 @@
1
1
  unit example.algebra
2
2
 
3
- -- Int32 arithmetic in this example wraps modulo 2^32 on every target.
4
- add :: Int32 -> Int32 -> Int32
5
- multiply :: Int32 -> Int32 -> Int32
6
- negateValue :: Int32 -> Int32
7
- maximumValue :: Int32 -> Int32 -> Int32
8
- subtractValue :: Int32 -> Int32 -> Int32
9
- divideLeft :: Int32 -> Int32 -> Int32
10
- divideRight :: Int32 -> Int32 -> Int32
3
+ -- Integer denotes mathematical integers. Adapter results must remain exact.
4
+ add :: Integer -> Integer -> Integer
5
+ multiply :: Integer -> Integer -> Integer
6
+ negateValue :: Integer -> Integer
7
+ maximumValue :: Integer -> Integer -> Integer
8
+ subtractValue :: Integer -> Integer -> Integer
9
+ divideLeft :: Integer -> Integer -> Integer
10
+ divideRight :: Integer -> Integer -> Integer
11
11
 
12
12
  law `addition is commutative` is
13
13
  definition is
@@ -20,6 +20,20 @@ law `addition is commutative` is
20
20
  expect add x y = 8
21
21
  expect add y x = 8
22
22
  end
23
+
24
+ example `addition exceeds the Int32 maximum without wrapping` is
25
+ x = 2147483647
26
+ y = 1
27
+ expect add x y = 2147483648
28
+ expect add y x = 2147483648
29
+ end
30
+
31
+ example `addition remains exact beyond machine and safe-number bounds` is
32
+ x = 18446744073709551615
33
+ y = 2
34
+ expect add x y = 18446744073709551617
35
+ expect add y x = 18446744073709551617
36
+ end
23
37
  end
24
38
 
25
39
  law `addition is associative` is
@@ -116,6 +130,14 @@ law `multiplication distributes over addition left` is
116
130
  expect multiply x (add y z) = 36
117
131
  expect add (multiply x y) (multiply x z) = 36
118
132
  end
133
+
134
+ example `multiplication preserves products outside Int32` is
135
+ x = 2147483647
136
+ y = 2147483647
137
+ z = 1
138
+ expect multiply x y = 4611686014132420609
139
+ expect multiply x (add y z) = 4611686016279904256
140
+ end
119
141
  end
120
142
 
121
143
  law `multiplication distributes over addition right` is
@@ -251,4 +273,10 @@ law `negation is an involution` is
251
273
  expect negateValue x = 3
252
274
  expect negateValue (negateValue x) = -3
253
275
  end
276
+
277
+ example `negating the Int32 minimum produces a positive integer` is
278
+ x = -2147483648
279
+ expect negateValue x = 2147483648
280
+ expect negateValue (negateValue x) = -2147483648
281
+ end
254
282
  end
@@ -0,0 +1,67 @@
1
+ unit example.collections
2
+
3
+ reverse :: List Int32 -> List Int32
4
+ sort :: List Int32 -> List Int32
5
+ sorted :: List Int32 -> Bool
6
+ permutation :: List Int32 -> List Int32 -> Bool
7
+ echoMaybe :: Maybe (Maybe Bool) -> Maybe (Maybe Bool)
8
+ echoEither :: Either (List Int32) (Maybe Bool) -> Either (List Int32) (Maybe Bool)
9
+ echoNested :: List (Maybe (Either CodeUnit16 Bytes)) -> List (Maybe (Either CodeUnit16 Bytes))
10
+
11
+ law `list involution` (f :: List a -> List a) requires Eq a is
12
+ definition is `involution` f end
13
+ end
14
+
15
+ law `reverse twice restores the list` is
16
+ definition is `list involution` reverse end
17
+ example `ordered input` is
18
+ x = [3, 1, 2]
19
+ expect reverse x = [2, 1, 3]
20
+ end
21
+ example `empty input` is x = [] expect reverse x = [] end
22
+ end
23
+
24
+ law `sorting is idempotent` is
25
+ definition is `idempotent` sort end
26
+ example `duplicates` is x = [3, 1, 3] expect sort x = [1, 3, 3] end
27
+ end
28
+
29
+ law `sort produces sorted output` is
30
+ definition is `for all` (xs :: List Int32) . sorted (sort xs) end
31
+ end
32
+
33
+ law `sort preserves length` is
34
+ definition is `for all` (xs :: List Int32) . prelude.length (sort xs) = prelude.length xs end
35
+ end
36
+
37
+ law `sort preserves elements` is
38
+ definition is `for all` (xs :: List Int32) . permutation (sort xs) xs end
39
+ end
40
+
41
+ law `nonempty reversal preserves length` is
42
+ definition is
43
+ `for all` (xs :: List Int32 where prelude.length xs > 0) .
44
+ prelude.length (reverse xs) = prelude.length xs
45
+ end
46
+ end
47
+
48
+ law `Maybe preserves nested absence` is
49
+ definition is `for all` (x :: Maybe (Maybe Bool)) . echoMaybe x = x end
50
+ example `outer absence` is x = Nothing expect echoMaybe x = Nothing end
51
+ example `inner absence` is x = Just Nothing expect echoMaybe x = Just Nothing end
52
+ example `present` is x = Just (Just true) expect echoMaybe x = Just (Just true) end
53
+ end
54
+
55
+ law `Either preserves branches` is
56
+ definition is `for all` (x :: Either (List Int32) (Maybe Bool)) . echoEither x = x end
57
+ example `left list` is x = Left [3, 1, 3] expect echoEither x = Left [3, 1, 3] end
58
+ example `right absence` is x = Right Nothing expect echoEither x = Right Nothing end
59
+ end
60
+
61
+ law `nested raw values survive` is
62
+ definition is `for all` (xs :: List (Maybe (Either CodeUnit16 Bytes))) . echoNested xs = xs end
63
+ example `surrogate and octets` is
64
+ xs = [Nothing, Just (Left codeUnit16(55296)), Just (Right bytes([0, 255]))]
65
+ expect echoNested xs = [Nothing, Just (Left codeUnit16(55296)), Just (Right bytes([0, 255]))]
66
+ end
67
+ end
@@ -1,6 +1,6 @@
1
1
  unit example.currying
2
2
 
3
- sumFour :: Int32 -> Int32 -> Int32 -> Int32 -> Int32
3
+ sumFour :: Integer -> Integer -> Integer -> Integer -> Integer
4
4
  format :: Text -> Bool -> Int32 -> Text -> Text
5
5
  referenceFormat :: Text -> Bool -> Int32 -> Text -> Text
6
6
  trim :: Text -> Text