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@59 is []>=0 and
26
- //│ > let $rest@60 = globalThis:block#1 #666.tupleSlice‹member:tupleSlice›(xs@59#2, 0, 0)
26
+ //│ > let $rest@60 = globalThis:import#Tuple #666.tupleSlice‹member:tupleSlice›(xs@59#2, 0, 0)
27
27
//│ > let ys@61 = $rest@60#0
28
28
//│ > else ys@61#666
29
29
//│ > xs@59 is []=0 then "empty"
@@ -58,8 +58,8 @@ fun foo(xs) = if xs is
58
58
//│ > if
59
59
//│ > xs@71 is []>=2 and
60
60
//│ > let $first0@74 = xs@71#2.0
61
- //│ > let $rest@73 = globalThis:block#1 #666.tupleSlice‹member:tupleSlice›(xs@71#3, 1, 1)
62
- //│ > let $last0@72 = globalThis:block#1 #666.tupleGet‹member:tupleGet›(xs@71#4, -1)
61
+ //│ > let $rest@73 = globalThis:import#Tuple #666.tupleSlice‹member:tupleSlice›(xs@71#3, 1, 1)
62
+ //│ > let $last0@72 = globalThis:import#Tuple #666.tupleGet‹member:tupleGet›(xs@71#4, -1)
63
63
//│ > let x@75 = $first0@74#0
64
64
//│ > let ys@76 = $rest@73#0
65
65
//│ > let y@77 = $last0@72#0
@@ -108,8 +108,8 @@ fun nested_tuple_patterns(xs) = if xs is
108
108
//│ > if
109
109
//│ > xs@96 is []>=2 and
110
110
//│ > let $first0@99 = xs@96#2.0
111
- //│ > let $rest@98 = globalThis:block#1 #666.tupleSlice‹member:tupleSlice›(xs@96#3, 1, 1)
112
- //│ > let $last0@97 = globalThis:block#1 #666.tupleGet‹member:tupleGet›(xs@96#4, -1)
111
+ //│ > let $rest@98 = globalThis:import#Tuple #666.tupleSlice‹member:tupleSlice›(xs@96#3, 1, 1)
112
+ //│ > let $last0@97 = globalThis:import#Tuple #666.tupleGet‹member:tupleGet›(xs@96#4, -1)
113
113
//│ > let x@100 = $first0@99#0
114
114
//│ > $rest@98 is []=2 and
115
115
//│ > let $first0@102 = $rest@98#1.0
0 commit comments