1
1
:js
2
2
:ucs desugared
3
3
4
- fun tupleSlice(xs, i, j) = globalThis.Array.prototype.slice.call(xs, i, xs.length - j)
5
- fun tupleGet(xs, i) = globalThis.Array.prototype.at.call(xs, i )
4
+ :import ../Prelude/Tuple.mls
5
+ //│ Imported 2 member(s )
6
6
7
7
// Drop the first and last elements.
8
8
tupleSlice([1, 2, 3, 4], 1, -1)
@@ -23,7 +23,7 @@ fun stupid(xs) = if xs is
23
23
//│ Desugared:
24
24
//│ > if
25
25
//│ > xs@41 is []>=0 and
26
- //│ > let $rest@42 = globalThis:block#1 #666.tupleSlice‹member:tupleSlice›(xs@41#2, 0, 0)
26
+ //│ > let $rest@42 = globalThis:import#Tuple #666.tupleSlice‹member:tupleSlice›(xs@41#2, 0, 0)
27
27
//│ > let ys@43 = $rest@42#0
28
28
//│ > else ys@43#666
29
29
//│ > xs@41 is []=0 then "empty"
@@ -58,8 +58,8 @@ fun foo(xs) = if xs is
58
58
//│ > if
59
59
//│ > xs@53 is []>=2 and
60
60
//│ > let $first0@56 = xs@53#2.0
61
- //│ > let $rest@55 = globalThis:block#1 #666.tupleSlice‹member:tupleSlice›(xs@53#3, 1, 1)
62
- //│ > let $last0@54 = globalThis:block#1 #666.tupleGet‹member:tupleGet›(xs@53#4, -1)
61
+ //│ > let $rest@55 = globalThis:import#Tuple #666.tupleSlice‹member:tupleSlice›(xs@53#3, 1, 1)
62
+ //│ > let $last0@54 = globalThis:import#Tuple #666.tupleGet‹member:tupleGet›(xs@53#4, -1)
63
63
//│ > let x@57 = $first0@56#0
64
64
//│ > let ys@58 = $rest@55#0
65
65
//│ > let y@59 = $last0@54#0
@@ -108,8 +108,8 @@ fun nested_tuple_patterns(xs) = if xs is
108
108
//│ > if
109
109
//│ > xs@78 is []>=2 and
110
110
//│ > let $first0@81 = xs@78#2.0
111
- //│ > let $rest@80 = globalThis:block#1 #666.tupleSlice‹member:tupleSlice›(xs@78#3, 1, 1)
112
- //│ > let $last0@79 = globalThis:block#1 #666.tupleGet‹member:tupleGet›(xs@78#4, -1)
111
+ //│ > let $rest@80 = globalThis:import#Tuple #666.tupleSlice‹member:tupleSlice›(xs@78#3, 1, 1)
112
+ //│ > let $last0@79 = globalThis:import#Tuple #666.tupleGet‹member:tupleGet›(xs@78#4, -1)
113
113
//│ > let x@82 = $first0@81#0
114
114
//│ > $rest@80 is []=2 and
115
115
//│ > let $first0@84 = $rest@80#1.0
0 commit comments