1- "use strict" ;
2-
31//------------------------------------------------------------------------------
42// Array creation --------------------------------------------------------------
53//------------------------------------------------------------------------------
64
7- exports . range = function ( start ) {
5+ export const range = function ( start ) {
86 return function ( end ) {
97 var step = start > end ? - 1 : 1 ;
108 var result = new Array ( step * ( end - start ) + 1 ) ;
@@ -40,9 +38,9 @@ var replicatePolyfill = function (count) {
4038} ;
4139
4240// In browsers that have Array.prototype.fill we use it, as it's faster.
43- exports . replicate = typeof Array . prototype . fill === "function" ? replicateFill : replicatePolyfill ;
41+ export const replicate = typeof Array . prototype . fill === "function" ? replicateFill : replicatePolyfill ;
4442
45- exports . fromFoldableImpl = ( function ( ) {
43+ export const fromFoldableImpl = ( function ( ) {
4644 function Cons ( head , tail ) {
4745 this . head = head ;
4846 this . tail = tail ;
@@ -77,15 +75,15 @@ exports.fromFoldableImpl = (function () {
7775// Array size ------------------------------------------------------------------
7876//------------------------------------------------------------------------------
7977
80- exports . length = function ( xs ) {
78+ export const length = function ( xs ) {
8179 return xs . length ;
8280} ;
8381
8482//------------------------------------------------------------------------------
8583// Non-indexed reads -----------------------------------------------------------
8684//------------------------------------------------------------------------------
8785
88- exports . unconsImpl = function ( empty ) {
86+ export const unconsImpl = function ( empty ) {
8987 return function ( next ) {
9088 return function ( xs ) {
9189 return xs . length === 0 ? empty ( { } ) : next ( xs [ 0 ] ) ( xs . slice ( 1 ) ) ;
@@ -97,7 +95,7 @@ exports.unconsImpl = function (empty) {
9795// Indexed operations ----------------------------------------------------------
9896//------------------------------------------------------------------------------
9997
100- exports . indexImpl = function ( just ) {
98+ export const indexImpl = function ( just ) {
10199 return function ( nothing ) {
102100 return function ( xs ) {
103101 return function ( i ) {
@@ -107,7 +105,7 @@ exports.indexImpl = function (just) {
107105 } ;
108106} ;
109107
110- exports . findMapImpl = function ( nothing ) {
108+ export const findMapImpl = function ( nothing ) {
111109 return function ( isJust ) {
112110 return function ( f ) {
113111 return function ( xs ) {
@@ -121,7 +119,7 @@ exports.findMapImpl = function (nothing) {
121119 } ;
122120} ;
123121
124- exports . findIndexImpl = function ( just ) {
122+ export const findIndexImpl = function ( just ) {
125123 return function ( nothing ) {
126124 return function ( f ) {
127125 return function ( xs ) {
@@ -134,7 +132,7 @@ exports.findIndexImpl = function (just) {
134132 } ;
135133} ;
136134
137- exports . findLastIndexImpl = function ( just ) {
135+ export const findLastIndexImpl = function ( just ) {
138136 return function ( nothing ) {
139137 return function ( f ) {
140138 return function ( xs ) {
@@ -147,7 +145,7 @@ exports.findLastIndexImpl = function (just) {
147145 } ;
148146} ;
149147
150- exports . _insertAt = function ( just ) {
148+ export const _insertAt = function ( just ) {
151149 return function ( nothing ) {
152150 return function ( i ) {
153151 return function ( a ) {
@@ -162,7 +160,7 @@ exports._insertAt = function (just) {
162160 } ;
163161} ;
164162
165- exports . _deleteAt = function ( just ) {
163+ export const _deleteAt = function ( just ) {
166164 return function ( nothing ) {
167165 return function ( i ) {
168166 return function ( l ) {
@@ -175,7 +173,7 @@ exports._deleteAt = function (just) {
175173 } ;
176174} ;
177175
178- exports . _updateAt = function ( just ) {
176+ export const _updateAt = function ( just ) {
179177 return function ( nothing ) {
180178 return function ( i ) {
181179 return function ( a ) {
@@ -194,11 +192,11 @@ exports._updateAt = function (just) {
194192// Transformations -------------------------------------------------------------
195193//------------------------------------------------------------------------------
196194
197- exports . reverse = function ( l ) {
195+ export const reverse = function ( l ) {
198196 return l . slice ( ) . reverse ( ) ;
199197} ;
200198
201- exports . concat = function ( xss ) {
199+ export const concat = function ( xss ) {
202200 if ( xss . length <= 10000 ) {
203201 // This method is faster, but it crashes on big arrays.
204202 // So we use it when can and fallback to simple variant otherwise.
@@ -215,13 +213,13 @@ exports.concat = function (xss) {
215213 return result ;
216214} ;
217215
218- exports . filter = function ( f ) {
216+ export const filter = function ( f ) {
219217 return function ( xs ) {
220218 return xs . filter ( f ) ;
221219 } ;
222220} ;
223221
224- exports . partition = function ( f ) {
222+ export const partition = function ( f ) {
225223 return function ( xs ) {
226224 var yes = [ ] ;
227225 var no = [ ] ;
@@ -236,7 +234,7 @@ exports.partition = function (f) {
236234 } ;
237235} ;
238236
239- exports . scanl = function ( f ) {
237+ export const scanl = function ( f ) {
240238 return function ( b ) {
241239 return function ( xs ) {
242240 var len = xs . length ;
@@ -251,7 +249,7 @@ exports.scanl = function (f) {
251249 } ;
252250} ;
253251
254- exports . scanr = function ( f ) {
252+ export const scanr = function ( f ) {
255253 return function ( b ) {
256254 return function ( xs ) {
257255 var len = xs . length ;
@@ -270,7 +268,7 @@ exports.scanr = function (f) {
270268// Sorting ---------------------------------------------------------------------
271269//------------------------------------------------------------------------------
272270
273- exports . sortByImpl = ( function ( ) {
271+ export const sortByImpl = ( function ( ) {
274272 function mergeFromTo ( compare , fromOrdering , xs1 , xs2 , from , to ) {
275273 var mid ;
276274 var i ;
@@ -328,7 +326,7 @@ exports.sortByImpl = (function () {
328326// Subarrays -------------------------------------------------------------------
329327//------------------------------------------------------------------------------
330328
331- exports . slice = function ( s ) {
329+ export const slice = function ( s ) {
332330 return function ( e ) {
333331 return function ( l ) {
334332 return l . slice ( s , e ) ;
@@ -340,7 +338,7 @@ exports.slice = function (s) {
340338// Zipping ---------------------------------------------------------------------
341339//------------------------------------------------------------------------------
342340
343- exports . zipWith = function ( f ) {
341+ export const zipWith = function ( f ) {
344342 return function ( xs ) {
345343 return function ( ys ) {
346344 var l = xs . length < ys . length ? xs . length : ys . length ;
@@ -357,7 +355,7 @@ exports.zipWith = function (f) {
357355// Folding ---------------------------------------------------------------------
358356//------------------------------------------------------------------------------
359357
360- exports . any = function ( p ) {
358+ export const any = function ( p ) {
361359 return function ( xs ) {
362360 var len = xs . length ;
363361 for ( var i = 0 ; i < len ; i ++ ) {
@@ -367,7 +365,7 @@ exports.any = function (p) {
367365 } ;
368366} ;
369367
370- exports . all = function ( p ) {
368+ export const all = function ( p ) {
371369 return function ( xs ) {
372370 var len = xs . length ;
373371 for ( var i = 0 ; i < len ; i ++ ) {
@@ -381,7 +379,7 @@ exports.all = function (p) {
381379// Partial ---------------------------------------------------------------------
382380//------------------------------------------------------------------------------
383381
384- exports . unsafeIndexImpl = function ( xs ) {
382+ export const unsafeIndexImpl = function ( xs ) {
385383 return function ( n ) {
386384 return xs [ n ] ;
387385 } ;
0 commit comments