1- function newSTArray ( ) {
1+ function newSTArray ( ) {
22 return [ ] ;
33}
44export { newSTArray as new } ;
55
6- export const peekImpl = function ( just ) {
7- return function ( nothing ) {
8- return function ( i ) {
9- return function ( xs ) {
10- return function ( ) {
11- return i >= 0 && i < xs . length ? just ( xs [ i ] ) : nothing ;
12- } ;
13- } ;
14- } ;
15- } ;
6+ export const peekImpl = function ( just , nothing , i , xs ) {
7+ return i >= 0 && i < xs . length ? just ( xs [ i ] ) : nothing ;
168} ;
179
18- export const poke = function ( i ) {
19- return function ( a ) {
20- return function ( xs ) {
21- return function ( ) {
22- var ret = i >= 0 && i < xs . length ;
23- if ( ret ) xs [ i ] = a ;
24- return ret ;
25- } ;
26- } ;
27- } ;
10+ export const pokeImpl = function ( i , a , xs ) {
11+ var ret = i >= 0 && i < xs . length ;
12+ if ( ret ) xs [ i ] = a ;
13+ return ret ;
2814} ;
2915
30- export const length = function ( xs ) {
31- return function ( ) {
32- return xs . length ;
33- } ;
16+ export const lengthImpl = function ( xs ) {
17+ return xs . length ;
3418} ;
3519
36- export const popImpl = function ( just ) {
37- return function ( nothing ) {
38- return function ( xs ) {
39- return function ( ) {
40- return xs . length > 0 ? just ( xs . pop ( ) ) : nothing ;
41- } ;
42- } ;
43- } ;
20+ export const popImpl = function ( just , nothing , xs ) {
21+ return xs . length > 0 ? just ( xs . pop ( ) ) : nothing ;
4422} ;
4523
46- export const pushAll = function ( as ) {
47- return function ( xs ) {
48- return function ( ) {
49- return xs . push . apply ( xs , as ) ;
50- } ;
51- } ;
24+ export const pushAllImpl = function ( as , xs ) {
25+ return xs . push . apply ( xs , as ) ;
5226} ;
5327
54- export const shiftImpl = function ( just ) {
55- return function ( nothing ) {
56- return function ( xs ) {
57- return function ( ) {
58- return xs . length > 0 ? just ( xs . shift ( ) ) : nothing ;
59- } ;
60- } ;
61- } ;
28+ export const shiftImpl = function ( just , nothing , xs ) {
29+ return xs . length > 0 ? just ( xs . shift ( ) ) : nothing ;
6230} ;
6331
64- export const unshiftAll = function ( as ) {
65- return function ( xs ) {
66- return function ( ) {
67- return xs . unshift . apply ( xs , as ) ;
68- } ;
69- } ;
32+ export const unshiftAllImpl = function ( as , xs ) {
33+ return xs . unshift . apply ( xs , as ) ;
7034} ;
7135
72- export const splice = function ( i ) {
73- return function ( howMany ) {
74- return function ( bs ) {
75- return function ( xs ) {
76- return function ( ) {
77- return xs . splice . apply ( xs , [ i , howMany ] . concat ( bs ) ) ;
78- } ;
79- } ;
80- } ;
81- } ;
36+ export const spliceImpl = function ( i , howMany , bs , xs ) {
37+ return xs . splice . apply ( xs , [ i , howMany ] . concat ( bs ) ) ;
8238} ;
8339
84- export const unsafeFreeze = function ( xs ) {
85- return function ( ) {
86- return xs ;
87- } ;
88- } ;
40+ function unsafeFreezeThawImpl ( xs ) {
41+ return xs ;
42+ }
8943
90- export const unsafeThaw = function ( xs ) {
91- return function ( ) {
92- return xs ;
93- } ;
94- } ;
44+ export const unsafeFreezeImpl = unsafeFreezeThawImpl ;
45+
46+ export const unsafeThawImpl = unsafeFreezeThawImpl ;
9547
9648function copyImpl ( xs ) {
97- return function ( ) {
98- return xs . slice ( ) ;
99- } ;
49+ return xs . slice ( ) ;
10050}
10151
102- export const freeze = copyImpl ;
52+ export const freezeImpl = copyImpl ;
10353
104- export const thaw = copyImpl ;
54+ export const thawImpl = copyImpl ;
10555
10656export const sortByImpl = ( function ( ) {
10757 function mergeFromTo ( compare , fromOrdering , xs1 , xs2 , from , to ) {
@@ -127,8 +77,7 @@ export const sortByImpl = (function () {
12777 if ( c > 0 ) {
12878 xs1 [ k ++ ] = y ;
12979 ++ j ;
130- }
131- else {
80+ } else {
13281 xs1 [ k ++ ] = x ;
13382 ++ i ;
13483 }
@@ -141,26 +90,18 @@ export const sortByImpl = (function () {
14190 }
14291 }
14392
144- return function ( compare ) {
145- return function ( fromOrdering ) {
146- return function ( xs ) {
147- return function ( ) {
148- if ( xs . length < 2 ) return xs ;
93+ return function ( compare , fromOrdering , xs ) {
94+ if ( xs . length < 2 ) return xs ;
14995
150- mergeFromTo ( compare , fromOrdering , xs , xs . slice ( 0 ) , 0 , xs . length ) ;
96+ mergeFromTo ( compare , fromOrdering , xs , xs . slice ( 0 ) , 0 , xs . length ) ;
15197
152- return xs ;
153- } ;
154- } ;
155- } ;
98+ return xs ;
15699 } ;
157100} ) ( ) ;
158101
159- export const toAssocArray = function ( xs ) {
160- return function ( ) {
161- var n = xs . length ;
162- var as = new Array ( n ) ;
163- for ( var i = 0 ; i < n ; i ++ ) as [ i ] = { value : xs [ i ] , index : i } ;
164- return as ;
165- } ;
102+ export const toAssocArrayImpl = function ( xs ) {
103+ var n = xs . length ;
104+ var as = new Array ( n ) ;
105+ for ( var i = 0 ; i < n ; i ++ ) as [ i ] = { value : xs [ i ] , index : i } ;
106+ return as ;
166107} ;
0 commit comments