firefly-compiler 0.4.66 → 0.4.67
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/compiler/Inference.ff +19 -3
- package/core/Array.ff +1 -1
- package/core/Float.ff +161 -8
- package/core/Int.ff +8 -0
- package/output/js/ff/compiler/Inference.mjs +100 -2
- package/output/js/ff/core/Array.mjs +2 -2
- package/output/js/ff/core/Float.mjs +311 -21
- package/output/js/ff/core/Int.mjs +16 -0
- package/package.json +1 -1
- package/vscode/package.json +1 -1
package/compiler/Inference.ff
CHANGED
|
@@ -914,9 +914,25 @@ extend self: Inference {
|
|
|
914
914
|
self.unification.unify(e.at, expected, TConstructor(e.at, core("Bool"), []))
|
|
915
915
|
e.ECall(target = target, arguments = [a1.Argument(value = e1), a2.Argument(value = e2)])
|
|
916
916
|
| [a1, a2] {
|
|
917
|
-
operator == "
|
|
918
|
-
|
|
919
|
-
|
|
917
|
+
operator == "/" || operator == "%"
|
|
918
|
+
} =>
|
|
919
|
+
let t1 = self.unification.freshUnificationVariable(e.at)
|
|
920
|
+
let t2 = self.unification.freshUnificationVariable(e.at)
|
|
921
|
+
let e1 = self.inferTerm(environment, t1, a1.value)
|
|
922
|
+
let e2 = self.inferTerm(environment, t2, a2.value)
|
|
923
|
+
let magic: Type => Unit = {t =>
|
|
924
|
+
self.unification.substitute(t).{
|
|
925
|
+
| TConstructor(_, name, []) {name == core("Float")} =>
|
|
926
|
+
| TConstructor(_, name, []) {name == core("Int")} =>
|
|
927
|
+
| _ => self.unification.unify(e.at, t, TConstructor(e.at, core("Float"), []))
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
magic(t1)
|
|
931
|
+
magic(t2)
|
|
932
|
+
self.unification.unify(e.at, expected, TConstructor(e.at, core("Float"), []))
|
|
933
|
+
e.ECall(target = target, arguments = [a1.Argument(value = e1), a2.Argument(value = e2)])
|
|
934
|
+
| [a1, a2] {
|
|
935
|
+
operator == "+" || operator == "-" || operator == "*" || operator == "^"
|
|
920
936
|
} =>
|
|
921
937
|
let t1 = self.unification.freshUnificationVariable(e.at)
|
|
922
938
|
let t2 = self.unification.freshUnificationVariable(e.at)
|
package/core/Array.ff
CHANGED
|
@@ -235,7 +235,7 @@ instance Array[T: Show]: Show {
|
|
|
235
235
|
sortRange[T](array: Array[T], compare: (T, T) => Ordering, start: Int, end: Int): Unit {
|
|
236
236
|
if(end - start < 2) {} else:
|
|
237
237
|
|
|
238
|
-
mutable middle = start + (
|
|
238
|
+
mutable middle = start + (end - start).div(2)
|
|
239
239
|
sortRange(array, compare, start, middle)
|
|
240
240
|
sortRange(array, compare, middle, end)
|
|
241
241
|
|
package/core/Float.ff
CHANGED
|
@@ -3,7 +3,7 @@ data Float {}
|
|
|
3
3
|
extend self: Float {
|
|
4
4
|
|
|
5
5
|
toInt(): Int
|
|
6
|
-
target js sync "return Math.trunc(
|
|
6
|
+
target js sync "return Math.trunc(self_) || 0"
|
|
7
7
|
|
|
8
8
|
round(): Float
|
|
9
9
|
target js sync "return Math.round(self_)"
|
|
@@ -26,16 +26,169 @@ extend self: Float {
|
|
|
26
26
|
toFixed(digits: Int): String
|
|
27
27
|
target js sync "return self_.toFixed(digits_)"
|
|
28
28
|
|
|
29
|
-
min(that: Float): Float
|
|
30
|
-
|
|
31
|
-
}
|
|
29
|
+
min(that: Float): Float
|
|
30
|
+
target js sync "return Math.min(self, that)"
|
|
32
31
|
|
|
33
|
-
max(that: Float): Float
|
|
34
|
-
|
|
35
|
-
}
|
|
32
|
+
max(that: Float): Float
|
|
33
|
+
target js sync "return Math.max(self, that)"
|
|
36
34
|
|
|
37
35
|
clamp(from: Float, to: Float): Float {
|
|
38
36
|
if(self <= from) {from} elseIf {self >= to} {to} else {self}
|
|
39
37
|
}
|
|
40
|
-
|
|
38
|
+
|
|
39
|
+
acos()
|
|
40
|
+
target js sync """
|
|
41
|
+
return Math.acos(self);
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
acosh()
|
|
45
|
+
target js sync """
|
|
46
|
+
return Math.acosh(self);
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
asin()
|
|
50
|
+
target js sync """
|
|
51
|
+
return Math.asin(self);
|
|
52
|
+
"""
|
|
53
|
+
|
|
54
|
+
asinh()
|
|
55
|
+
target js sync """
|
|
56
|
+
return Math.asinh(self);
|
|
57
|
+
"""
|
|
58
|
+
|
|
59
|
+
atan()
|
|
60
|
+
target js sync """
|
|
61
|
+
return Math.atan(self);
|
|
62
|
+
"""
|
|
63
|
+
|
|
64
|
+
atan2(that: Float)
|
|
65
|
+
target js sync """
|
|
66
|
+
return Math.atan2(self, that);
|
|
67
|
+
"""
|
|
68
|
+
|
|
69
|
+
atanh()
|
|
70
|
+
target js sync """
|
|
71
|
+
return Math.atanh(self);
|
|
72
|
+
"""
|
|
73
|
+
|
|
74
|
+
cbrt()
|
|
75
|
+
target js sync """
|
|
76
|
+
return Math.cbrt(self);
|
|
77
|
+
"""
|
|
78
|
+
|
|
79
|
+
cos()
|
|
80
|
+
target js sync """
|
|
81
|
+
return Math.cos(self);
|
|
82
|
+
"""
|
|
83
|
+
|
|
84
|
+
cosh()
|
|
85
|
+
target js sync """
|
|
86
|
+
return Math.cosh(self);
|
|
87
|
+
"""
|
|
88
|
+
|
|
89
|
+
exp()
|
|
90
|
+
target js sync """
|
|
91
|
+
return Math.exp(self);
|
|
92
|
+
"""
|
|
93
|
+
|
|
94
|
+
expm1()
|
|
95
|
+
target js sync """
|
|
96
|
+
return Math.expm1(self);
|
|
97
|
+
"""
|
|
98
|
+
|
|
99
|
+
log(that: Float)
|
|
100
|
+
target js sync """
|
|
101
|
+
return Math.log2(self) / Math.log2(that);
|
|
102
|
+
"""
|
|
103
|
+
|
|
104
|
+
log10()
|
|
105
|
+
target js sync """
|
|
106
|
+
return Math.log10(self);
|
|
107
|
+
"""
|
|
108
|
+
|
|
109
|
+
log2()
|
|
110
|
+
target js sync """
|
|
111
|
+
return Math.log2(self);
|
|
112
|
+
"""
|
|
113
|
+
|
|
114
|
+
ln()
|
|
115
|
+
target js sync """
|
|
116
|
+
return Math.log(self);
|
|
117
|
+
"""
|
|
118
|
+
|
|
119
|
+
ln1p()
|
|
120
|
+
target js sync """
|
|
121
|
+
return Math.log1p(self);
|
|
122
|
+
"""
|
|
123
|
+
|
|
124
|
+
sin()
|
|
125
|
+
target js sync """
|
|
126
|
+
return Math.sin(self);
|
|
127
|
+
"""
|
|
128
|
+
|
|
129
|
+
sinh()
|
|
130
|
+
target js sync """
|
|
131
|
+
return Math.sinh(self);
|
|
132
|
+
"""
|
|
133
|
+
|
|
134
|
+
sqrt()
|
|
135
|
+
target js sync """
|
|
136
|
+
return Math.sqrt(self);
|
|
137
|
+
"""
|
|
138
|
+
|
|
139
|
+
tan()
|
|
140
|
+
target js sync """
|
|
141
|
+
return Math.tan(self);
|
|
142
|
+
"""
|
|
143
|
+
|
|
144
|
+
tanh()
|
|
145
|
+
target js sync """
|
|
146
|
+
return Math.tanh(self);
|
|
147
|
+
"""
|
|
148
|
+
|
|
41
149
|
}
|
|
150
|
+
|
|
151
|
+
hypot(values: List[Float]): Float
|
|
152
|
+
target js sync """
|
|
153
|
+
return Math.hypot(...values);
|
|
154
|
+
"""
|
|
155
|
+
|
|
156
|
+
e(): Float
|
|
157
|
+
target js sync """
|
|
158
|
+
return Math.E;
|
|
159
|
+
"""
|
|
160
|
+
|
|
161
|
+
ln10(): Float
|
|
162
|
+
target js sync """
|
|
163
|
+
return Math.LN10;
|
|
164
|
+
"""
|
|
165
|
+
|
|
166
|
+
ln2(): Float
|
|
167
|
+
target js sync """
|
|
168
|
+
return Math.LN2;
|
|
169
|
+
"""
|
|
170
|
+
|
|
171
|
+
log10e(): Float
|
|
172
|
+
target js sync """
|
|
173
|
+
return Math.LOG10E;
|
|
174
|
+
"""
|
|
175
|
+
|
|
176
|
+
log2e(): Float
|
|
177
|
+
target js sync """
|
|
178
|
+
return Math.LOG2E;
|
|
179
|
+
"""
|
|
180
|
+
|
|
181
|
+
pi(): Float
|
|
182
|
+
target js sync """
|
|
183
|
+
return Math.PI;
|
|
184
|
+
"""
|
|
185
|
+
|
|
186
|
+
sqrtHalf(): Float
|
|
187
|
+
target js sync """
|
|
188
|
+
return Math.SQRT1_2;
|
|
189
|
+
"""
|
|
190
|
+
|
|
191
|
+
sqrt2(): Float
|
|
192
|
+
target js sync """
|
|
193
|
+
return Math.SQRT2;
|
|
194
|
+
"""
|
package/core/Int.ff
CHANGED
|
@@ -1650,7 +1650,56 @@ return
|
|
|
1650
1650
|
if(_1.length === 2) {
|
|
1651
1651
|
const a1_ = _1[0];
|
|
1652
1652
|
const a2_ = _1[1];
|
|
1653
|
-
if(((
|
|
1653
|
+
if(((operator_ === "/") || (operator_ === "%"))) {
|
|
1654
|
+
const t1_ = ff_compiler_Unification.Unification_freshUnificationVariable(self_.unification_, e_.at_);
|
|
1655
|
+
const t2_ = ff_compiler_Unification.Unification_freshUnificationVariable(self_.unification_, e_.at_);
|
|
1656
|
+
const e1_ = ff_compiler_Inference.Inference_inferTerm(self_, environment_, t1_, a1_.value_);
|
|
1657
|
+
const e2_ = ff_compiler_Inference.Inference_inferTerm(self_, environment_, t2_, a2_.value_);
|
|
1658
|
+
const magic_ = ((t_) => {
|
|
1659
|
+
{
|
|
1660
|
+
const _1 = ff_compiler_Unification.Unification_substitute(self_.unification_, t_);
|
|
1661
|
+
if(_1.TConstructor && _1.generics_.length === 0) {
|
|
1662
|
+
const name_ = _1.name_;
|
|
1663
|
+
if((name_ === ff_compiler_Inference.core_("Float"))) {
|
|
1664
|
+
|
|
1665
|
+
return
|
|
1666
|
+
}
|
|
1667
|
+
}
|
|
1668
|
+
if(_1.TConstructor && _1.generics_.length === 0) {
|
|
1669
|
+
const name_ = _1.name_;
|
|
1670
|
+
if((name_ === ff_compiler_Inference.core_("Int"))) {
|
|
1671
|
+
|
|
1672
|
+
return
|
|
1673
|
+
}
|
|
1674
|
+
}
|
|
1675
|
+
{
|
|
1676
|
+
ff_compiler_Unification.Unification_unify(self_.unification_, e_.at_, t_, ff_compiler_Syntax.TConstructor(e_.at_, ff_compiler_Inference.core_("Float"), []))
|
|
1677
|
+
return
|
|
1678
|
+
}
|
|
1679
|
+
}
|
|
1680
|
+
});
|
|
1681
|
+
magic_(t1_);
|
|
1682
|
+
magic_(t2_);
|
|
1683
|
+
ff_compiler_Unification.Unification_unify(self_.unification_, e_.at_, expected_, ff_compiler_Syntax.TConstructor(e_.at_, ff_compiler_Inference.core_("Float"), []));
|
|
1684
|
+
{
|
|
1685
|
+
const _1 = e_;
|
|
1686
|
+
{
|
|
1687
|
+
const _c = _1;
|
|
1688
|
+
return ff_compiler_Syntax.ECall(_c.at_, target_, _c.effect_, _c.typeArguments_, [(((_c) => {
|
|
1689
|
+
return ff_compiler_Syntax.Argument(_c.at_, _c.name_, e1_)
|
|
1690
|
+
}))(a1_), (((_c) => {
|
|
1691
|
+
return ff_compiler_Syntax.Argument(_c.at_, _c.name_, e2_)
|
|
1692
|
+
}))(a2_)], _c.dictionaries_)
|
|
1693
|
+
return
|
|
1694
|
+
}
|
|
1695
|
+
}
|
|
1696
|
+
return
|
|
1697
|
+
}
|
|
1698
|
+
}
|
|
1699
|
+
if(_1.length === 2) {
|
|
1700
|
+
const a1_ = _1[0];
|
|
1701
|
+
const a2_ = _1[1];
|
|
1702
|
+
if(((((operator_ === "+") || (operator_ === "-")) || (operator_ === "*")) || (operator_ === "^"))) {
|
|
1654
1703
|
const t1_ = ff_compiler_Unification.Unification_freshUnificationVariable(self_.unification_, e_.at_);
|
|
1655
1704
|
const t2_ = ff_compiler_Unification.Unification_freshUnificationVariable(self_.unification_, e_.at_);
|
|
1656
1705
|
const e1_ = ff_compiler_Inference.Inference_inferTerm(self_, environment_, t1_, a1_.value_);
|
|
@@ -3448,7 +3497,56 @@ return
|
|
|
3448
3497
|
if(_1.length === 2) {
|
|
3449
3498
|
const a1_ = _1[0];
|
|
3450
3499
|
const a2_ = _1[1];
|
|
3451
|
-
if(((
|
|
3500
|
+
if(((operator_ === "/") || (operator_ === "%"))) {
|
|
3501
|
+
const t1_ = ff_compiler_Unification.Unification_freshUnificationVariable(self_.unification_, e_.at_);
|
|
3502
|
+
const t2_ = ff_compiler_Unification.Unification_freshUnificationVariable(self_.unification_, e_.at_);
|
|
3503
|
+
const e1_ = ff_compiler_Inference.Inference_inferTerm(self_, environment_, t1_, a1_.value_);
|
|
3504
|
+
const e2_ = ff_compiler_Inference.Inference_inferTerm(self_, environment_, t2_, a2_.value_);
|
|
3505
|
+
const magic_ = ((t_) => {
|
|
3506
|
+
{
|
|
3507
|
+
const _1 = ff_compiler_Unification.Unification_substitute(self_.unification_, t_);
|
|
3508
|
+
if(_1.TConstructor && _1.generics_.length === 0) {
|
|
3509
|
+
const name_ = _1.name_;
|
|
3510
|
+
if((name_ === ff_compiler_Inference.core_("Float"))) {
|
|
3511
|
+
|
|
3512
|
+
return
|
|
3513
|
+
}
|
|
3514
|
+
}
|
|
3515
|
+
if(_1.TConstructor && _1.generics_.length === 0) {
|
|
3516
|
+
const name_ = _1.name_;
|
|
3517
|
+
if((name_ === ff_compiler_Inference.core_("Int"))) {
|
|
3518
|
+
|
|
3519
|
+
return
|
|
3520
|
+
}
|
|
3521
|
+
}
|
|
3522
|
+
{
|
|
3523
|
+
ff_compiler_Unification.Unification_unify(self_.unification_, e_.at_, t_, ff_compiler_Syntax.TConstructor(e_.at_, ff_compiler_Inference.core_("Float"), []))
|
|
3524
|
+
return
|
|
3525
|
+
}
|
|
3526
|
+
}
|
|
3527
|
+
});
|
|
3528
|
+
magic_(t1_);
|
|
3529
|
+
magic_(t2_);
|
|
3530
|
+
ff_compiler_Unification.Unification_unify(self_.unification_, e_.at_, expected_, ff_compiler_Syntax.TConstructor(e_.at_, ff_compiler_Inference.core_("Float"), []));
|
|
3531
|
+
{
|
|
3532
|
+
const _1 = e_;
|
|
3533
|
+
{
|
|
3534
|
+
const _c = _1;
|
|
3535
|
+
return ff_compiler_Syntax.ECall(_c.at_, target_, _c.effect_, _c.typeArguments_, [(((_c) => {
|
|
3536
|
+
return ff_compiler_Syntax.Argument(_c.at_, _c.name_, e1_)
|
|
3537
|
+
}))(a1_), (((_c) => {
|
|
3538
|
+
return ff_compiler_Syntax.Argument(_c.at_, _c.name_, e2_)
|
|
3539
|
+
}))(a2_)], _c.dictionaries_)
|
|
3540
|
+
return
|
|
3541
|
+
}
|
|
3542
|
+
}
|
|
3543
|
+
return
|
|
3544
|
+
}
|
|
3545
|
+
}
|
|
3546
|
+
if(_1.length === 2) {
|
|
3547
|
+
const a1_ = _1[0];
|
|
3548
|
+
const a2_ = _1[1];
|
|
3549
|
+
if(((((operator_ === "+") || (operator_ === "-")) || (operator_ === "*")) || (operator_ === "^"))) {
|
|
3452
3550
|
const t1_ = ff_compiler_Unification.Unification_freshUnificationVariable(self_.unification_, e_.at_);
|
|
3453
3551
|
const t2_ = ff_compiler_Unification.Unification_freshUnificationVariable(self_.unification_, e_.at_);
|
|
3454
3552
|
const e1_ = ff_compiler_Inference.Inference_inferTerm(self_, environment_, t1_, a1_.value_);
|
|
@@ -121,7 +121,7 @@ export function sortRange_(array_, compare_, start_, end_) {
|
|
|
121
121
|
if(((end_ - start_) < 2)) {
|
|
122
122
|
|
|
123
123
|
} else {
|
|
124
|
-
let middle_ = (start_ + ((end_ - start_)
|
|
124
|
+
let middle_ = (start_ + ff_core_Int.Int_div((end_ - start_), 2));
|
|
125
125
|
ff_core_Array.sortRange_(array_, compare_, start_, middle_);
|
|
126
126
|
ff_core_Array.sortRange_(array_, compare_, middle_, end_);
|
|
127
127
|
let i_ = start_;
|
|
@@ -171,7 +171,7 @@ export async function sortRange_$(array_, compare_, start_, end_, $task) {
|
|
|
171
171
|
if(((end_ - start_) < 2)) {
|
|
172
172
|
|
|
173
173
|
} else {
|
|
174
|
-
let middle_ = (start_ + ((end_ - start_)
|
|
174
|
+
let middle_ = (start_ + ff_core_Int.Int_div((end_ - start_), 2));
|
|
175
175
|
(await ff_core_Array.sortRange_$(array_, compare_, start_, middle_, $task));
|
|
176
176
|
(await ff_core_Array.sortRange_$(array_, compare_, middle_, end_, $task));
|
|
177
177
|
let i_ = start_;
|
|
@@ -95,12 +95,98 @@ import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
|
95
95
|
|
|
96
96
|
|
|
97
97
|
|
|
98
|
+
export function hypot_(values_) {
|
|
99
|
+
|
|
100
|
+
return Math.hypot(...values);
|
|
101
|
+
|
|
102
|
+
}
|
|
98
103
|
|
|
104
|
+
export function e_() {
|
|
105
|
+
|
|
106
|
+
return Math.E;
|
|
107
|
+
|
|
108
|
+
}
|
|
99
109
|
|
|
110
|
+
export function ln10_() {
|
|
111
|
+
|
|
112
|
+
return Math.LN10;
|
|
113
|
+
|
|
114
|
+
}
|
|
100
115
|
|
|
116
|
+
export function ln2_() {
|
|
117
|
+
|
|
118
|
+
return Math.LN2;
|
|
119
|
+
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export function log10e_() {
|
|
123
|
+
|
|
124
|
+
return Math.LOG10E;
|
|
125
|
+
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export function log2e_() {
|
|
129
|
+
|
|
130
|
+
return Math.LOG2E;
|
|
131
|
+
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export function pi_() {
|
|
135
|
+
|
|
136
|
+
return Math.PI;
|
|
137
|
+
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export function sqrtHalf_() {
|
|
141
|
+
|
|
142
|
+
return Math.SQRT1_2;
|
|
143
|
+
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export function sqrt2_() {
|
|
147
|
+
|
|
148
|
+
return Math.SQRT2;
|
|
149
|
+
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export async function hypot_$(values_, $task) {
|
|
153
|
+
throw new Error('Function hypot is missing on this target in async context.');
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export async function e_$($task) {
|
|
157
|
+
throw new Error('Function e is missing on this target in async context.');
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export async function ln10_$($task) {
|
|
161
|
+
throw new Error('Function ln10 is missing on this target in async context.');
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export async function ln2_$($task) {
|
|
165
|
+
throw new Error('Function ln2 is missing on this target in async context.');
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export async function log10e_$($task) {
|
|
169
|
+
throw new Error('Function log10e is missing on this target in async context.');
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export async function log2e_$($task) {
|
|
173
|
+
throw new Error('Function log2e is missing on this target in async context.');
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export async function pi_$($task) {
|
|
177
|
+
throw new Error('Function pi is missing on this target in async context.');
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export async function sqrtHalf_$($task) {
|
|
181
|
+
throw new Error('Function sqrtHalf is missing on this target in async context.');
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export async function sqrt2_$($task) {
|
|
185
|
+
throw new Error('Function sqrt2 is missing on this target in async context.');
|
|
186
|
+
}
|
|
101
187
|
|
|
102
188
|
export function Float_toInt(self_) {
|
|
103
|
-
return Math.trunc(
|
|
189
|
+
return Math.trunc(self_) || 0
|
|
104
190
|
}
|
|
105
191
|
|
|
106
192
|
export function Float_round(self_) {
|
|
@@ -132,19 +218,11 @@ return self_.toFixed(digits_)
|
|
|
132
218
|
}
|
|
133
219
|
|
|
134
220
|
export function Float_min(self_, that_) {
|
|
135
|
-
|
|
136
|
-
return self_
|
|
137
|
-
} else {
|
|
138
|
-
return that_
|
|
139
|
-
}
|
|
221
|
+
return Math.min(self, that)
|
|
140
222
|
}
|
|
141
223
|
|
|
142
224
|
export function Float_max(self_, that_) {
|
|
143
|
-
|
|
144
|
-
return self_
|
|
145
|
-
} else {
|
|
146
|
-
return that_
|
|
147
|
-
}
|
|
225
|
+
return Math.max(self, that)
|
|
148
226
|
}
|
|
149
227
|
|
|
150
228
|
export function Float_clamp(self_, from_, to_) {
|
|
@@ -157,6 +235,138 @@ return self_
|
|
|
157
235
|
}
|
|
158
236
|
}
|
|
159
237
|
|
|
238
|
+
export function Float_acos(self_) {
|
|
239
|
+
|
|
240
|
+
return Math.acos(self);
|
|
241
|
+
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export function Float_acosh(self_) {
|
|
245
|
+
|
|
246
|
+
return Math.acosh(self);
|
|
247
|
+
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export function Float_asin(self_) {
|
|
251
|
+
|
|
252
|
+
return Math.asin(self);
|
|
253
|
+
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export function Float_asinh(self_) {
|
|
257
|
+
|
|
258
|
+
return Math.asinh(self);
|
|
259
|
+
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export function Float_atan(self_) {
|
|
263
|
+
|
|
264
|
+
return Math.atan(self);
|
|
265
|
+
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
export function Float_atan2(self_, that_) {
|
|
269
|
+
|
|
270
|
+
return Math.atan2(self, that);
|
|
271
|
+
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export function Float_atanh(self_) {
|
|
275
|
+
|
|
276
|
+
return Math.atanh(self);
|
|
277
|
+
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export function Float_cbrt(self_) {
|
|
281
|
+
|
|
282
|
+
return Math.cbrt(self);
|
|
283
|
+
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export function Float_cos(self_) {
|
|
287
|
+
|
|
288
|
+
return Math.cos(self);
|
|
289
|
+
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export function Float_cosh(self_) {
|
|
293
|
+
|
|
294
|
+
return Math.cosh(self);
|
|
295
|
+
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
export function Float_exp(self_) {
|
|
299
|
+
|
|
300
|
+
return Math.exp(self);
|
|
301
|
+
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export function Float_expm1(self_) {
|
|
305
|
+
|
|
306
|
+
return Math.expm1(self);
|
|
307
|
+
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
export function Float_log(self_, that_) {
|
|
311
|
+
|
|
312
|
+
return Math.log2(self) / Math.log2(that);
|
|
313
|
+
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
export function Float_log10(self_) {
|
|
317
|
+
|
|
318
|
+
return Math.log10(self);
|
|
319
|
+
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
export function Float_log2(self_) {
|
|
323
|
+
|
|
324
|
+
return Math.log2(self);
|
|
325
|
+
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
export function Float_ln(self_) {
|
|
329
|
+
|
|
330
|
+
return Math.log(self);
|
|
331
|
+
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export function Float_ln1p(self_) {
|
|
335
|
+
|
|
336
|
+
return Math.log1p(self);
|
|
337
|
+
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
export function Float_sin(self_) {
|
|
341
|
+
|
|
342
|
+
return Math.sin(self);
|
|
343
|
+
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export function Float_sinh(self_) {
|
|
347
|
+
|
|
348
|
+
return Math.sinh(self);
|
|
349
|
+
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
export function Float_sqrt(self_) {
|
|
353
|
+
|
|
354
|
+
return Math.sqrt(self);
|
|
355
|
+
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
export function Float_tan(self_) {
|
|
359
|
+
|
|
360
|
+
return Math.tan(self);
|
|
361
|
+
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
export function Float_tanh(self_) {
|
|
365
|
+
|
|
366
|
+
return Math.tanh(self);
|
|
367
|
+
|
|
368
|
+
}
|
|
369
|
+
|
|
160
370
|
export async function Float_toInt$(self_, $task) {
|
|
161
371
|
throw new Error('Function Float_toInt is missing on this target in async context.');
|
|
162
372
|
}
|
|
@@ -190,19 +400,11 @@ throw new Error('Function Float_toFixed is missing on this target in async conte
|
|
|
190
400
|
}
|
|
191
401
|
|
|
192
402
|
export async function Float_min$(self_, that_, $task) {
|
|
193
|
-
|
|
194
|
-
return self_
|
|
195
|
-
} else {
|
|
196
|
-
return that_
|
|
197
|
-
}
|
|
403
|
+
throw new Error('Function Float_min is missing on this target in async context.');
|
|
198
404
|
}
|
|
199
405
|
|
|
200
406
|
export async function Float_max$(self_, that_, $task) {
|
|
201
|
-
|
|
202
|
-
return self_
|
|
203
|
-
} else {
|
|
204
|
-
return that_
|
|
205
|
-
}
|
|
407
|
+
throw new Error('Function Float_max is missing on this target in async context.');
|
|
206
408
|
}
|
|
207
409
|
|
|
208
410
|
export async function Float_clamp$(self_, from_, to_, $task) {
|
|
@@ -215,6 +417,94 @@ return self_
|
|
|
215
417
|
}
|
|
216
418
|
}
|
|
217
419
|
|
|
420
|
+
export async function Float_acos$(self_, $task) {
|
|
421
|
+
throw new Error('Function Float_acos is missing on this target in async context.');
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
export async function Float_acosh$(self_, $task) {
|
|
425
|
+
throw new Error('Function Float_acosh is missing on this target in async context.');
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
export async function Float_asin$(self_, $task) {
|
|
429
|
+
throw new Error('Function Float_asin is missing on this target in async context.');
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
export async function Float_asinh$(self_, $task) {
|
|
433
|
+
throw new Error('Function Float_asinh is missing on this target in async context.');
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
export async function Float_atan$(self_, $task) {
|
|
437
|
+
throw new Error('Function Float_atan is missing on this target in async context.');
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
export async function Float_atan2$(self_, that_, $task) {
|
|
441
|
+
throw new Error('Function Float_atan2 is missing on this target in async context.');
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
export async function Float_atanh$(self_, $task) {
|
|
445
|
+
throw new Error('Function Float_atanh is missing on this target in async context.');
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
export async function Float_cbrt$(self_, $task) {
|
|
449
|
+
throw new Error('Function Float_cbrt is missing on this target in async context.');
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
export async function Float_cos$(self_, $task) {
|
|
453
|
+
throw new Error('Function Float_cos is missing on this target in async context.');
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
export async function Float_cosh$(self_, $task) {
|
|
457
|
+
throw new Error('Function Float_cosh is missing on this target in async context.');
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
export async function Float_exp$(self_, $task) {
|
|
461
|
+
throw new Error('Function Float_exp is missing on this target in async context.');
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
export async function Float_expm1$(self_, $task) {
|
|
465
|
+
throw new Error('Function Float_expm1 is missing on this target in async context.');
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
export async function Float_log$(self_, that_, $task) {
|
|
469
|
+
throw new Error('Function Float_log is missing on this target in async context.');
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
export async function Float_log10$(self_, $task) {
|
|
473
|
+
throw new Error('Function Float_log10 is missing on this target in async context.');
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
export async function Float_log2$(self_, $task) {
|
|
477
|
+
throw new Error('Function Float_log2 is missing on this target in async context.');
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
export async function Float_ln$(self_, $task) {
|
|
481
|
+
throw new Error('Function Float_ln is missing on this target in async context.');
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
export async function Float_ln1p$(self_, $task) {
|
|
485
|
+
throw new Error('Function Float_ln1p is missing on this target in async context.');
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
export async function Float_sin$(self_, $task) {
|
|
489
|
+
throw new Error('Function Float_sin is missing on this target in async context.');
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
export async function Float_sinh$(self_, $task) {
|
|
493
|
+
throw new Error('Function Float_sinh is missing on this target in async context.');
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
export async function Float_sqrt$(self_, $task) {
|
|
497
|
+
throw new Error('Function Float_sqrt is missing on this target in async context.');
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
export async function Float_tan$(self_, $task) {
|
|
501
|
+
throw new Error('Function Float_tan is missing on this target in async context.');
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
export async function Float_tanh$(self_, $task) {
|
|
505
|
+
throw new Error('Function Float_tanh is missing on this target in async context.');
|
|
506
|
+
}
|
|
507
|
+
|
|
218
508
|
export const ff_core_Any_HasAnyTag$ff_core_Float_Float = {
|
|
219
509
|
anyTag_() {
|
|
220
510
|
return ff_core_Any.internalAnyTag_((("ff:core/Float.Float" + "[") + "]"))
|
|
@@ -181,6 +181,14 @@ export function Int_pad(self_, padding_) {
|
|
|
181
181
|
return ff_core_String.String_padStart(("" + self_), ff_core_String.String_size(padding_), padding_)
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
+
export function Int_div(self_, divisor_) {
|
|
185
|
+
return ff_core_Float.Float_toInt((self_ / divisor_))
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export function Int_rem(self_, divisor_) {
|
|
189
|
+
return ff_core_Float.Float_toInt((self_ % divisor_))
|
|
190
|
+
}
|
|
191
|
+
|
|
184
192
|
export async function Int_abs$(self_, $task) {
|
|
185
193
|
throw new Error('Function Int_abs is missing on this target in async context.');
|
|
186
194
|
}
|
|
@@ -263,6 +271,14 @@ export async function Int_pad$(self_, padding_, $task) {
|
|
|
263
271
|
return ff_core_String.String_padStart(("" + self_), ff_core_String.String_size(padding_), padding_)
|
|
264
272
|
}
|
|
265
273
|
|
|
274
|
+
export async function Int_div$(self_, divisor_, $task) {
|
|
275
|
+
return ff_core_Float.Float_toInt((self_ / divisor_))
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export async function Int_rem$(self_, divisor_, $task) {
|
|
279
|
+
return ff_core_Float.Float_toInt((self_ % divisor_))
|
|
280
|
+
}
|
|
281
|
+
|
|
266
282
|
export const ff_core_Any_HasAnyTag$ff_core_Int_Int = {
|
|
267
283
|
anyTag_() {
|
|
268
284
|
return ff_core_Any.internalAnyTag_((("ff:core/Int.Int" + "[") + "]"))
|
package/package.json
CHANGED