lawspec 0.24.0 → 0.26.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/CHANGELOG.md +109 -1
- package/README.md +34 -26
- package/UNICODE-LICENSE.txt +39 -0
- package/api.mjs +6 -23
- package/bin/lawspec.mjs +148 -65
- package/build.json +245 -177
- package/builtin-data-names.mjs +73 -0
- package/core.wasm +2 -2
- package/core_jsffi.js +5 -0
- package/examples/native-payments/clojure/lawspec.json +13 -2
- package/examples/native-payments/csharp/lawspec.json +13 -2
- package/examples/native-payments/elixir/lawspec.json +14 -3
- package/examples/native-payments/erlang/lawspec.json +14 -3
- package/examples/native-payments/fsharp/lawspec.json +14 -3
- package/examples/native-payments/gleam/lawspec.json +14 -3
- package/examples/native-payments/go/lawspec.json +14 -3
- package/examples/native-payments/groovy/lawspec.json +14 -3
- package/examples/native-payments/haskell/lawspec.json +14 -3
- package/examples/native-payments/java/lawspec.json +14 -3
- package/examples/native-payments/javascript/lawspec.json +14 -3
- package/examples/native-payments/kotlin/lawspec.json +14 -3
- package/examples/native-payments/python/lawspec.json +14 -3
- package/examples/native-payments/rust/lawspec.json +14 -3
- package/examples/native-payments/scala/lawspec.json +14 -3
- package/examples/native-payments/swift/lawspec.json +14 -3
- package/examples/native-payments/typescript/lawspec.json +14 -3
- package/examples/packages/orders/lawspec.json +25 -5
- package/examples/packages/orders/orders.lawspec +57 -53
- package/examples/packages/shop-domain/src/domain.lawspec +36 -33
- package/examples/packages/shop-tax-1/src/api.lawspec +1 -0
- package/examples/packages/shop-tax-1/src/rates.lawspec +5 -4
- package/examples/packages/shop-tax-2/src/api.lawspec +1 -0
- package/examples/packages/shop-tax-2/src/rates.lawspec +6 -4
- package/examples/rc1/authorization-snapshots.lawspec +113 -0
- package/examples/rc1/banner-filenames.lawspec +64 -0
- package/examples/rc1/bit-codec.lawspec +57 -0
- package/examples/rc1/bounded-witness-search.lawspec +151 -0
- package/examples/rc1/conflicting-requirements.lawspec +31 -0
- package/examples/rc1/constructive-witnesses.lawspec +120 -0
- package/examples/rc1/documentary-review.lawspec +43 -0
- package/examples/rc1/empty-domains.lawspec +47 -0
- package/examples/rc1/finite-integer-domains.lawspec +76 -0
- package/examples/rc1/law-metadata.lawspec +30 -0
- package/examples/rc1/native-payments.lawspec +108 -0
- package/examples/rc1/nesting/rrr.lawspec +34 -0
- package/examples/rc1/nesting/rru.lawspec +57 -0
- package/examples/rc1/nesting/rur.lawspec +58 -0
- package/examples/rc1/nesting/ruu.lawspec +78 -0
- package/examples/rc1/nesting/urr.lawspec +53 -0
- package/examples/rc1/nesting/uru.lawspec +73 -0
- package/examples/rc1/nesting/uur.lawspec +74 -0
- package/examples/rc1/nesting/uuu.lawspec +96 -0
- package/examples/rc1/order-workflow.lawspec +127 -0
- package/examples/rc1/parcel-measurements.lawspec +93 -0
- package/examples/rc1/picture-records.lawspec +52 -0
- package/examples/rc1/picture-tuples.lawspec +48 -0
- package/examples/rc1/record-payloads.lawspec +57 -0
- package/examples/rc1/recursive-records.lawspec +65 -0
- package/examples/rc1/refund-conformance.lawspec +45 -0
- package/examples/rc1/refund-policy.lawspec +89 -0
- package/examples/rc1/requirement-composition.lawspec +90 -0
- package/examples/rc1/structural-records.lawspec +54 -0
- package/examples/rc1-authoring.lawspec +57 -0
- package/examples/specs/abilities.lawspec +67 -65
- package/examples/specs/ability_imports.lawspec +58 -57
- package/examples/specs/actors.lawspec +23 -22
- package/examples/specs/algebra.lawspec +142 -141
- package/examples/specs/approvals.lawspec +16 -15
- package/examples/specs/async_bindings.lawspec +10 -9
- package/examples/specs/async_fetch.lawspec +12 -11
- package/examples/specs/atoi_codec.lawspec +16 -15
- package/examples/specs/boolean_flags.lawspec +10 -9
- package/examples/specs/builtins.lawspec +73 -72
- package/examples/specs/canonical_url.lawspec +14 -13
- package/examples/specs/collections.lawspec +153 -154
- package/examples/specs/composition.lawspec +70 -66
- package/examples/specs/concurrent_collections.lawspec +8 -7
- package/examples/specs/consistency.lawspec +4 -3
- package/examples/specs/contracts.lawspec +80 -79
- package/examples/specs/crypto.lawspec +26 -25
- package/examples/specs/ctc.lawspec +148 -0
- package/examples/specs/currying.lawspec +32 -31
- package/examples/specs/data_types.lawspec +50 -49
- package/examples/specs/distribution.lawspec +57 -56
- package/examples/specs/domain_modeling.lawspec +48 -47
- package/examples/specs/durations.lawspec +39 -38
- package/examples/specs/equivalent.lawspec +25 -24
- package/examples/specs/failures.lawspec +64 -63
- package/examples/specs/finite_data.lawspec +32 -31
- package/examples/specs/flow_stack.lawspec +64 -63
- package/examples/specs/gadt_expressions.lawspec +50 -49
- package/examples/specs/generation.lawspec +115 -114
- package/examples/specs/handler_bindings.lawspec +42 -40
- package/examples/specs/handles.lawspec +2 -1
- package/examples/specs/harness.lawspec +45 -43
- package/examples/specs/harness_testing.lawspec +18 -13
- package/examples/specs/indexed_arithmetic.lawspec +401 -126
- package/examples/specs/indexed_families.lawspec +182 -66
- package/examples/specs/keywords.lawspec +22 -21
- package/examples/specs/limits.lawspec +6 -5
- package/examples/specs/list_contracts.lawspec +121 -120
- package/examples/specs/list_refinements.lawspec +43 -42
- package/examples/specs/lists.lawspec +45 -44
- package/examples/specs/matchers.lawspec +79 -78
- package/examples/specs/matching.lawspec +43 -42
- package/examples/specs/mixed_inputs.lawspec +25 -24
- package/examples/specs/models.lawspec +44 -43
- package/examples/specs/parse_port.lawspec +28 -27
- package/examples/specs/payments.lawspec +55 -54
- package/examples/specs/railway.lawspec +59 -58
- package/examples/specs/records.lawspec +149 -148
- package/examples/specs/records_inner.lawspec +5 -4
- package/examples/specs/recursive_refinements.lawspec +30 -29
- package/examples/specs/refined_definitions.lawspec +24 -23
- package/examples/specs/refinements.lawspec +58 -57
- package/examples/specs/resilience.lawspec +159 -158
- package/examples/specs/resources.lawspec +61 -60
- package/examples/specs/scalar_adapters.lawspec +60 -59
- package/examples/specs/scalar_catalog.lawspec +165 -164
- package/examples/specs/scalars.lawspec +78 -77
- package/examples/specs/scheduling_order.lawspec +8 -7
- package/examples/specs/scheduling_overlap.lawspec +5 -4
- package/examples/specs/sequences.lawspec +66 -65
- package/examples/specs/sessions.lawspec +13 -12
- package/examples/specs/slug.lawspec +16 -15
- package/examples/specs/sum_refinements.lawspec +42 -41
- package/examples/specs/tables.lawspec +29 -28
- package/examples/specs/total_functions.lawspec +71 -70
- package/examples/specs/workflows.lawspec +101 -100
- package/examples-command.mjs +8 -4
- package/explain.mjs +114 -0
- package/expression-presentation.mjs +333 -0
- package/files.mjs +16 -0
- package/index.d.ts +406 -11
- package/launcher.mjs +9 -2
- package/lsp.mjs +235 -0
- package/native-evidence.mjs +187 -0
- package/native-examples.mjs +8 -1
- package/node-events-reporter.mjs +23 -0
- package/package.json +8 -1
- package/positional-fields.mjs +13 -0
- package/proof.d.ts +35 -0
- package/proof.mjs +174 -0
- package/starter-rc1.lawspec +26 -0
- package/starter.lawspec +16 -15
- package/templates.mjs +6 -4
- package/test-command.mjs +107 -35
- package/typed-presentation.mjs +165 -0
|
@@ -4,7 +4,7 @@ echoCodePoint :: CodePoint -> CodePoint
|
|
|
4
4
|
echoCodeUnit :: CodeUnit16 -> CodeUnit16
|
|
5
5
|
echoBytes :: Bytes -> Bytes
|
|
6
6
|
echoComplex :: Complex64 -> Complex64
|
|
7
|
-
successor :: Int8 ->
|
|
7
|
+
successor :: Int8 -> Integer
|
|
8
8
|
narrow :: Int8 -> Int8
|
|
9
9
|
addDecimal :: Decimal -> Decimal -> Decimal
|
|
10
10
|
sameSymbol :: Symbol -> Symbol -> Bool
|
|
@@ -14,70 +14,71 @@ finish :: Unit -> Unit
|
|
|
14
14
|
preserveBig :: UInt64 -> UInt64
|
|
15
15
|
machineEcho :: IntSize -> IntSize
|
|
16
16
|
|
|
17
|
-
law
|
|
18
|
-
definition
|
|
19
|
-
example
|
|
20
|
-
end
|
|
21
|
-
law
|
|
22
|
-
definition
|
|
23
|
-
example
|
|
24
|
-
end
|
|
25
|
-
law
|
|
26
|
-
definition
|
|
27
|
-
example
|
|
28
|
-
end
|
|
29
|
-
law
|
|
30
|
-
definition
|
|
31
|
-
example
|
|
17
|
+
law "|promoted successor| is
|
|
18
|
+
definition : for all (x :: Int8) => successor x = x + 1 end for all end definition
|
|
19
|
+
example "|no overflow| : x = 127 expect successor x = 128 end example
|
|
20
|
+
end law
|
|
21
|
+
law "|checked bridge| is
|
|
22
|
+
definition : for all (x :: Int8) => narrow (x + 0) = x end for all end definition
|
|
23
|
+
example "|maximum| : x = 127 expect narrow (x + 0) = 127 end example
|
|
24
|
+
end law
|
|
25
|
+
law "|exact decimal adapter| is
|
|
26
|
+
definition : for all (x :: Decimal) (y :: Decimal) => addDecimal x y = x + y end for all end definition
|
|
27
|
+
example "|tenths| : x = 0.1 y = 0.2 expect addDecimal x y = 0.3 end example
|
|
28
|
+
end law
|
|
29
|
+
law "|symbol identity adapter| is
|
|
30
|
+
definition : for all (x :: Symbol) (y :: Symbol) => sameSymbol x x and sameSymbol y y end for all end definition
|
|
31
|
+
example "|same description distinct identities| :
|
|
32
32
|
x = symbol("a", "same") y = symbol("b", "same")
|
|
33
33
|
expect sameSymbol x y = false
|
|
34
34
|
expect sameSymbol x x = true
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
law
|
|
38
|
-
definition
|
|
39
|
-
example
|
|
40
|
-
end
|
|
41
|
-
law
|
|
42
|
-
definition
|
|
43
|
-
example
|
|
44
|
-
example
|
|
45
|
-
end
|
|
46
|
-
law
|
|
47
|
-
definition
|
|
48
|
-
example
|
|
49
|
-
end
|
|
35
|
+
end example
|
|
36
|
+
end law
|
|
37
|
+
law "|raw adapter| is
|
|
38
|
+
definition : for all (x :: Utf16Text) => echoRaw x = x end for all end definition
|
|
39
|
+
example "|lone surrogate| : x = utf16([55296]) expect echoRaw x = utf16([55296]) end example
|
|
40
|
+
end law
|
|
41
|
+
law "|presence adapter| is
|
|
42
|
+
definition : for all (x :: Optional (Nullable Int8)) => echoPresence x = x end for all end definition
|
|
43
|
+
example "|missing| : x = undefined expect echoPresence x = undefined end example
|
|
44
|
+
example "|null present| : x = optional(null) expect echoPresence x = optional(null) end example
|
|
45
|
+
end law
|
|
46
|
+
law "|unit adapter| is
|
|
47
|
+
definition : for all (x :: Unit) => finish x = unitValue end for all end definition
|
|
48
|
+
example "|completed| : x = unitValue expect finish x = unitValue end example
|
|
49
|
+
end law
|
|
50
50
|
|
|
51
|
-
law
|
|
52
|
-
definition
|
|
53
|
-
example
|
|
54
|
-
end
|
|
55
|
-
law
|
|
56
|
-
definition
|
|
57
|
-
example
|
|
58
|
-
end
|
|
51
|
+
law "|no safe-number truncation| is
|
|
52
|
+
definition : for all (x :: UInt64) => preserveBig x = x end for all end definition
|
|
53
|
+
example "|unsigned maximum| : x = 18446744073709551615 expect preserveBig x = 18446744073709551615 end example
|
|
54
|
+
end law
|
|
55
|
+
law "|machine profile binding| is
|
|
56
|
+
definition : for all (x :: IntSize) => machineEcho x = x end for all end definition
|
|
57
|
+
example "|portable width| : x = 2147483647 expect machineEcho x = 2147483647 end example
|
|
58
|
+
end law
|
|
59
59
|
|
|
60
|
-
law
|
|
61
|
-
definition
|
|
62
|
-
example
|
|
63
|
-
end
|
|
60
|
+
law "|Char native bridge| is
|
|
61
|
+
definition : for all (x :: Char) => echoChar x = x end for all end definition
|
|
62
|
+
example "|native value| : x = char(128512) expect echoChar x = char(128512) end example
|
|
63
|
+
end law
|
|
64
64
|
|
|
65
|
-
law
|
|
66
|
-
definition
|
|
67
|
-
example
|
|
68
|
-
end
|
|
65
|
+
law "|CodePoint native bridge| is
|
|
66
|
+
definition : for all (x :: CodePoint) => echoCodePoint x = x end for all end definition
|
|
67
|
+
example "|native value| : x = codePoint(55296) expect echoCodePoint x = codePoint(55296) end example
|
|
68
|
+
end law
|
|
69
69
|
|
|
70
|
-
law
|
|
71
|
-
definition
|
|
72
|
-
example
|
|
73
|
-
end
|
|
70
|
+
law "|CodeUnit16 native bridge| is
|
|
71
|
+
definition : for all (x :: CodeUnit16) => echoCodeUnit x = x end for all end definition
|
|
72
|
+
example "|native value| : x = codeUnit16(65535) expect echoCodeUnit x = codeUnit16(65535) end example
|
|
73
|
+
end law
|
|
74
74
|
|
|
75
|
-
law
|
|
76
|
-
definition
|
|
77
|
-
example
|
|
78
|
-
end
|
|
75
|
+
law "|Bytes native bridge| is
|
|
76
|
+
definition : for all (x :: Bytes) => echoBytes x = x end for all end definition
|
|
77
|
+
example "|native value| : x = bytes([0,128,255]) expect echoBytes x = bytes([0,128,255]) end example
|
|
78
|
+
end law
|
|
79
79
|
|
|
80
|
-
law
|
|
81
|
-
definition
|
|
82
|
-
example
|
|
83
|
-
end
|
|
80
|
+
law "|Complex64 native bridge| is
|
|
81
|
+
definition : for all (x :: Complex64) => prelude.isNaN (prelude.real (echoComplex x)) = prelude.isNaN (prelude.real x) end for all end definition
|
|
82
|
+
example "|native value| : x = complex64(1,2) expect echoComplex x = complex64(1,2) end example
|
|
83
|
+
end law
|
|
84
|
+
end unit
|
|
@@ -1,166 +1,167 @@
|
|
|
1
1
|
unit example.scalar_catalog
|
|
2
2
|
|
|
3
|
-
law
|
|
4
|
-
definition
|
|
5
|
-
example
|
|
6
|
-
end
|
|
7
|
-
|
|
8
|
-
law
|
|
9
|
-
definition
|
|
10
|
-
example
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
law
|
|
14
|
-
definition
|
|
15
|
-
example
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
law
|
|
19
|
-
definition
|
|
20
|
-
example
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
law
|
|
24
|
-
definition
|
|
25
|
-
example
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
law
|
|
29
|
-
definition
|
|
30
|
-
example
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
law
|
|
34
|
-
definition
|
|
35
|
-
example
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
law
|
|
39
|
-
definition
|
|
40
|
-
example
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
law
|
|
44
|
-
definition
|
|
45
|
-
example
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
law
|
|
49
|
-
definition
|
|
50
|
-
example
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
law
|
|
54
|
-
definition
|
|
55
|
-
example
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
law
|
|
59
|
-
definition
|
|
60
|
-
example
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
law
|
|
64
|
-
definition
|
|
65
|
-
example
|
|
66
|
-
end
|
|
67
|
-
|
|
68
|
-
law
|
|
69
|
-
definition
|
|
70
|
-
example
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
law
|
|
74
|
-
definition
|
|
75
|
-
example
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
law
|
|
79
|
-
definition
|
|
80
|
-
example
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
law
|
|
84
|
-
definition
|
|
85
|
-
example
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
law
|
|
89
|
-
definition
|
|
90
|
-
example
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
law
|
|
94
|
-
definition
|
|
95
|
-
example
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
law
|
|
99
|
-
definition
|
|
100
|
-
example
|
|
101
|
-
end
|
|
102
|
-
|
|
103
|
-
law
|
|
104
|
-
definition
|
|
105
|
-
example
|
|
106
|
-
end
|
|
107
|
-
|
|
108
|
-
law
|
|
109
|
-
definition
|
|
110
|
-
example
|
|
111
|
-
end
|
|
112
|
-
|
|
113
|
-
law
|
|
114
|
-
definition
|
|
115
|
-
example
|
|
116
|
-
end
|
|
117
|
-
|
|
118
|
-
law
|
|
119
|
-
definition
|
|
120
|
-
example
|
|
121
|
-
end
|
|
122
|
-
|
|
123
|
-
law
|
|
124
|
-
definition
|
|
125
|
-
example
|
|
126
|
-
end
|
|
127
|
-
|
|
128
|
-
law
|
|
129
|
-
definition
|
|
130
|
-
example
|
|
131
|
-
end
|
|
132
|
-
|
|
133
|
-
law
|
|
134
|
-
definition
|
|
135
|
-
example
|
|
136
|
-
end
|
|
137
|
-
|
|
138
|
-
law
|
|
139
|
-
definition
|
|
140
|
-
example
|
|
141
|
-
end
|
|
142
|
-
|
|
143
|
-
law
|
|
144
|
-
definition
|
|
145
|
-
example
|
|
146
|
-
end
|
|
147
|
-
|
|
148
|
-
law
|
|
149
|
-
definition
|
|
150
|
-
example
|
|
151
|
-
end
|
|
152
|
-
|
|
153
|
-
law
|
|
154
|
-
definition
|
|
155
|
-
example
|
|
156
|
-
end
|
|
157
|
-
|
|
158
|
-
law
|
|
159
|
-
definition
|
|
160
|
-
example
|
|
161
|
-
end
|
|
162
|
-
|
|
163
|
-
law
|
|
164
|
-
definition
|
|
165
|
-
example
|
|
166
|
-
end
|
|
3
|
+
law "|Bool representation| is
|
|
4
|
+
definition : for all (x :: Bool) => x = x end for all end definition
|
|
5
|
+
example "|explicit value| : x = true expect x = true end example
|
|
6
|
+
end law
|
|
7
|
+
|
|
8
|
+
law "|Int8 representation| is
|
|
9
|
+
definition : for all (x :: Int8) => x = x end for all end definition
|
|
10
|
+
example "|explicit value| : x = -128 expect x = -128 end example
|
|
11
|
+
end law
|
|
12
|
+
|
|
13
|
+
law "|Int16 representation| is
|
|
14
|
+
definition : for all (x :: Int16) => x = x end for all end definition
|
|
15
|
+
example "|explicit value| : x = 32767 expect x = 32767 end example
|
|
16
|
+
end law
|
|
17
|
+
|
|
18
|
+
law "|Int32 representation| is
|
|
19
|
+
definition : for all (x :: Int32) => x = x end for all end definition
|
|
20
|
+
example "|explicit value| : x = 2147483647 expect x = 2147483647 end example
|
|
21
|
+
end law
|
|
22
|
+
|
|
23
|
+
law "|Int64 representation| is
|
|
24
|
+
definition : for all (x :: Int64) => x = x end for all end definition
|
|
25
|
+
example "|explicit value| : x = 9223372036854775807 expect x = 9223372036854775807 end example
|
|
26
|
+
end law
|
|
27
|
+
|
|
28
|
+
law "|UInt8 representation| is
|
|
29
|
+
definition : for all (x :: UInt8) => x = x end for all end definition
|
|
30
|
+
example "|explicit value| : x = 255 expect x = 255 end example
|
|
31
|
+
end law
|
|
32
|
+
|
|
33
|
+
law "|UInt16 representation| is
|
|
34
|
+
definition : for all (x :: UInt16) => x = x end for all end definition
|
|
35
|
+
example "|explicit value| : x = 65535 expect x = 65535 end example
|
|
36
|
+
end law
|
|
37
|
+
|
|
38
|
+
law "|UInt32 representation| is
|
|
39
|
+
definition : for all (x :: UInt32) => x = x end for all end definition
|
|
40
|
+
example "|explicit value| : x = 4294967295 expect x = 4294967295 end example
|
|
41
|
+
end law
|
|
42
|
+
|
|
43
|
+
law "|UInt64 representation| is
|
|
44
|
+
definition : for all (x :: UInt64) => x = x end for all end definition
|
|
45
|
+
example "|explicit value| : x = 18446744073709551615 expect x = 18446744073709551615 end example
|
|
46
|
+
end law
|
|
47
|
+
|
|
48
|
+
law "|IntSize representation| is
|
|
49
|
+
definition : for all (x :: IntSize) => x = x end for all end definition
|
|
50
|
+
example "|explicit value| : x = 2147483647 expect x = 2147483647 end example
|
|
51
|
+
end law
|
|
52
|
+
|
|
53
|
+
law "|UIntSize representation| is
|
|
54
|
+
definition : for all (x :: UIntSize) => x = x end for all end definition
|
|
55
|
+
example "|explicit value| : x = 4294967295 expect x = 4294967295 end example
|
|
56
|
+
end law
|
|
57
|
+
|
|
58
|
+
law "|UIntPtr representation| is
|
|
59
|
+
definition : for all (x :: UIntPtr) => x = x end for all end definition
|
|
60
|
+
example "|explicit value| : x = 4294967295 expect x = 4294967295 end example
|
|
61
|
+
end law
|
|
62
|
+
|
|
63
|
+
law "|BigInt representation| is
|
|
64
|
+
definition : for all (x :: Integer) => x = x end for all end definition
|
|
65
|
+
example "|explicit value| : x = -1234567890123456789012345678901234567890 expect x = -1234567890123456789012345678901234567890 end example
|
|
66
|
+
end law
|
|
67
|
+
|
|
68
|
+
law "|BigUInt representation| is
|
|
69
|
+
definition : for all (x :: Whole) => x = x end for all end definition
|
|
70
|
+
example "|explicit value| : x = 1234567890123456789012345678901234567890 expect x = 1234567890123456789012345678901234567890 end example
|
|
71
|
+
end law
|
|
72
|
+
|
|
73
|
+
law "|Decimal representation| is
|
|
74
|
+
definition : for all (x :: Decimal) => x = x end for all end definition
|
|
75
|
+
example "|explicit value| : x = 0.000000000000000000000000000000000001 expect x = 0.000000000000000000000000000000000001 end example
|
|
76
|
+
end law
|
|
77
|
+
|
|
78
|
+
law "|Rational representation| is
|
|
79
|
+
definition : for all (x :: Rational) => x = x end for all end definition
|
|
80
|
+
example "|explicit value| : x = rational(-7, 11) expect x = rational(-7, 11) end example
|
|
81
|
+
end law
|
|
82
|
+
|
|
83
|
+
law "|Float32 representation| is
|
|
84
|
+
definition : for all (x :: Float32) => prelude.isNaN x = prelude.isNaN x end for all end definition
|
|
85
|
+
example "|explicit value| : x = float32Bits("80000000") expect x = float32Bits("80000000") end example
|
|
86
|
+
end law
|
|
87
|
+
|
|
88
|
+
law "|Float64 representation| is
|
|
89
|
+
definition : for all (x :: Float64) => prelude.isNaN x = prelude.isNaN x end for all end definition
|
|
90
|
+
example "|explicit value| : x = float64Bits("7ff0000000000000") expect x = float64Bits("7ff0000000000000") end example
|
|
91
|
+
end law
|
|
92
|
+
|
|
93
|
+
law "|Complex64 representation| is
|
|
94
|
+
definition : for all (x :: Complex64) => prelude.isNaN (prelude.real x) = prelude.isNaN (prelude.real x) end for all end definition
|
|
95
|
+
example "|explicit value| : x = complex64(1, -2) expect x = complex64(1, -2) end example
|
|
96
|
+
end law
|
|
97
|
+
|
|
98
|
+
law "|Complex128 representation| is
|
|
99
|
+
definition : for all (x :: Complex128) => prelude.isNaN (prelude.real x) = prelude.isNaN (prelude.real x) end for all end definition
|
|
100
|
+
example "|explicit value| : x = complex128(0.5, -3.5) expect x = complex128(0.5, -3.5) end example
|
|
101
|
+
end law
|
|
102
|
+
|
|
103
|
+
law "|Char representation| is
|
|
104
|
+
definition : for all (x :: Char) => x = x end for all end definition
|
|
105
|
+
example "|explicit value| : x = char(128512) expect x = char(128512) end example
|
|
106
|
+
end law
|
|
107
|
+
|
|
108
|
+
law "|CodePoint representation| is
|
|
109
|
+
definition : for all (x :: CodePoint) => x = x end for all end definition
|
|
110
|
+
example "|explicit value| : x = codePoint(55296) expect x = codePoint(55296) end example
|
|
111
|
+
end law
|
|
112
|
+
|
|
113
|
+
law "|CodeUnit16 representation| is
|
|
114
|
+
definition : for all (x :: CodeUnit16) => x = x end for all end definition
|
|
115
|
+
example "|explicit value| : x = codeUnit16(65535) expect x = codeUnit16(65535) end example
|
|
116
|
+
end law
|
|
117
|
+
|
|
118
|
+
law "|Text representation| is
|
|
119
|
+
definition : for all (x :: Text) => x = x end for all end definition
|
|
120
|
+
example "|explicit value| : x = "λ日本語😀" expect x = "λ日本語😀" end example
|
|
121
|
+
end law
|
|
122
|
+
|
|
123
|
+
law "|CodePointText representation| is
|
|
124
|
+
definition : for all (x :: CodePointText) => x = x end for all end definition
|
|
125
|
+
example "|explicit value| : x = codePoints([55296, 1114111]) expect x = codePoints([55296, 1114111]) end example
|
|
126
|
+
end law
|
|
127
|
+
|
|
128
|
+
law "|Utf16Text representation| is
|
|
129
|
+
definition : for all (x :: Utf16Text) => x = x end for all end definition
|
|
130
|
+
example "|explicit value| : x = utf16([55296, 0, 65535]) expect x = utf16([55296, 0, 65535]) end example
|
|
131
|
+
end law
|
|
132
|
+
|
|
133
|
+
law "|Bytes representation| is
|
|
134
|
+
definition : for all (x :: Bytes) => x = x end for all end definition
|
|
135
|
+
example "|explicit value| : x = bytes([0, 128, 255]) expect x = bytes([0, 128, 255]) end example
|
|
136
|
+
end law
|
|
137
|
+
|
|
138
|
+
law "|Symbol representation| is
|
|
139
|
+
definition : for all (x :: Symbol) => x = x end for all end definition
|
|
140
|
+
example "|explicit value| : x = symbol("catalog", "same") expect x = symbol("catalog", "same") end example
|
|
141
|
+
end law
|
|
142
|
+
|
|
143
|
+
law "|Unit representation| is
|
|
144
|
+
definition : for all (x :: Unit) => x = x end for all end definition
|
|
145
|
+
example "|explicit value| : x = unitValue expect x = unitValue end example
|
|
146
|
+
end law
|
|
147
|
+
|
|
148
|
+
law "|Null representation| is
|
|
149
|
+
definition : for all (x :: Null) => x = x end for all end definition
|
|
150
|
+
example "|explicit value| : x = null expect x = null end example
|
|
151
|
+
end law
|
|
152
|
+
|
|
153
|
+
law "|Undefined representation| is
|
|
154
|
+
definition : for all (x :: Undefined) => x = x end for all end definition
|
|
155
|
+
example "|explicit value| : x = undefined expect x = undefined end example
|
|
156
|
+
end law
|
|
157
|
+
|
|
158
|
+
law "|Nullable Int8 representation| is
|
|
159
|
+
definition : for all (x :: Nullable Int8) => x = x end for all end definition
|
|
160
|
+
example "|explicit value| : x = nullable(127) expect x = nullable(127) end example
|
|
161
|
+
end law
|
|
162
|
+
|
|
163
|
+
law "|Optional Int8 representation| is
|
|
164
|
+
definition : for all (x :: Optional Int8) => x = x end for all end definition
|
|
165
|
+
example "|explicit value| : x = undefined expect x = undefined end example
|
|
166
|
+
end law
|
|
167
|
+
end unit
|