1
- function newSTArray ( ) {
1
+ function newSTArray ( ) {
2
2
return [ ] ;
3
3
}
4
4
export { newSTArray as new } ;
5
5
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 ;
16
8
} ;
17
9
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 ;
28
14
} ;
29
15
30
- export const length = function ( xs ) {
31
- return function ( ) {
32
- return xs . length ;
33
- } ;
16
+ export const lengthImpl = function ( xs ) {
17
+ return xs . length ;
34
18
} ;
35
19
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 ;
44
22
} ;
45
23
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 ) ;
52
26
} ;
53
27
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 ;
62
30
} ;
63
31
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 ) ;
70
34
} ;
71
35
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 ) ) ;
82
38
} ;
83
39
84
- export const unsafeFreeze = function ( xs ) {
85
- return function ( ) {
86
- return xs ;
87
- } ;
88
- } ;
40
+ function unsafeFreezeThawImpl ( xs ) {
41
+ return xs ;
42
+ }
89
43
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 ;
95
47
96
48
function copyImpl ( xs ) {
97
- return function ( ) {
98
- return xs . slice ( ) ;
99
- } ;
49
+ return xs . slice ( ) ;
100
50
}
101
51
102
- export const freeze = copyImpl ;
52
+ export const freezeImpl = copyImpl ;
103
53
104
- export const thaw = copyImpl ;
54
+ export const thawImpl = copyImpl ;
105
55
106
56
export const sortByImpl = ( function ( ) {
107
57
function mergeFromTo ( compare , fromOrdering , xs1 , xs2 , from , to ) {
@@ -127,8 +77,7 @@ export const sortByImpl = (function () {
127
77
if ( c > 0 ) {
128
78
xs1 [ k ++ ] = y ;
129
79
++ j ;
130
- }
131
- else {
80
+ } else {
132
81
xs1 [ k ++ ] = x ;
133
82
++ i ;
134
83
}
@@ -141,26 +90,18 @@ export const sortByImpl = (function () {
141
90
}
142
91
}
143
92
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 ;
149
95
150
- mergeFromTo ( compare , fromOrdering , xs , xs . slice ( 0 ) , 0 , xs . length ) ;
96
+ mergeFromTo ( compare , fromOrdering , xs , xs . slice ( 0 ) , 0 , xs . length ) ;
151
97
152
- return xs ;
153
- } ;
154
- } ;
155
- } ;
98
+ return xs ;
156
99
} ;
157
100
} ) ( ) ;
158
101
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 ;
166
107
} ;
0 commit comments