@@ -44,7 +44,7 @@ difference = foldl @ converse @ delete;
4444 * drop 3 "abcd" == "d"
4545 * drop :: num -> [*] -> [*]
4646 */
47- drop n l
47+ drop n l
4848 = l, n <= 0 || l == []
4949 = drop (n - 1) (tl l);
5050
@@ -93,11 +93,11 @@ flatten x
9393
9494/* foldl fn st l: fold list l from the left with function fn and start st
9595 *
96- * Start from the left hand end of the list (unlike foldr, see below).
96+ * Start from the left hand end of the list (unlike foldr, see below).
9797 * foldl is less useful (and much slower).
9898 *
9999 * foldl fn start [a,b .. z] = ((((st fn a) fn b) ..) fn z)
100- * foldl :: (* -> ** -> *) -> * -> [**] -> *
100+ * foldl :: (* -> ** -> *) -> * -> [**] -> *
101101 */
102102foldl fn st l
103103 = st, l == []
@@ -221,15 +221,15 @@ len l
221221 * limit :: [*] -> *
222222 */
223223limit l
224- = error "incorrect use of limit",
224+ = error "incorrect use of limit",
225225 l == [] || tl l == [] || tl (tl l) == []
226226 = a, a == b
227227 = limit (b : x)
228228{
229229 a:b:x = l;
230230}
231231
232- /* Turn a function of n args into a function which takes a single arg of an
232+ /* Turn a function of n args into a function which takes a single arg of an
233233 * n-element list.
234234 */
235235list_1ary fn x = fn x?0;
@@ -248,13 +248,13 @@ map f l
248248 = [], l == [];
249249 = f (hd l) : map f (tl l);
250250
251- /* map2 fn l1 l2: map two lists together with fn
251+ /* map2 fn l1 l2: map two lists together with fn
252252 *
253253 * map2 :: (* -> ** -> ***) -> [*] -> [**] -> [***]
254254 */
255255map2 fn l1 l2 = map (list_2ary fn) (zip2 l1 l2);
256256
257- /* map3 fn l1 l2 l3: map three lists together with fn
257+ /* map3 fn l1 l2 l3: map three lists together with fn
258258 *
259259 * map3 :: (* -> ** -> *** -> ****) -> [*] -> [**] -> [***] -> [****]
260260 */
@@ -348,7 +348,7 @@ sortc comp l
348348 n = len l;
349349 n2 = (int) (n / 2);
350350
351- /* merge l1 l2: merge sorted lists l1 and l2 to make a single
351+ /* merge l1 l2: merge sorted lists l1 and l2 to make a single
352352 * sorted list
353353 */
354354 merge l1 l2
@@ -397,38 +397,38 @@ sortr l = sortc more l;
397397split fn l
398398 = [], l == [] || l' == []
399399 = head : split fn tail
400- {
400+ {
401401 nfn = not @ fn;
402402
403403 l' = dropwhile fn l;
404404 head = takewhile nfn l';
405405 tail = dropwhile nfn l';
406- }
406+ }
407407
408408/* splits fn l: break a list into sections separated by a single fn
409409 *
410410 * split (equal ',') ",,1" == ["", "", "1"]
411411 * split :: (* -> bool) -> [*] -> [[*]]
412412 */
413413splits fn l
414- = [], l == []
414+ = [], l == []
415415 = head : splits fn tail
416- {
416+ {
417417 fn' = not @ fn;
418- dropif x
418+ dropif x
419419 = [], x == []
420420 = tl x;
421421
422422 head = takewhile fn' l;
423423 tail = dropif (dropwhile fn' l);
424- }
424+ }
425425
426426/* splitpl fnl l: split a list up with a list of predicates
427427 *
428428 * splitpl [is_digit, is_letter, is_digit] "123cat" == ["123", "cat", []]
429429 * splitpl :: [* -> bool] -> [*] -> [[*]]
430430 */
431- splitpl fnl l
431+ splitpl fnl l
432432 = l, fnl == []
433433 = head : splitpl (tl fnl) tail
434434{
@@ -448,7 +448,7 @@ split_lines n l
448448/* take n l: take the first n elements from list l
449449 * take :: num -> [*] -> [*]
450450 */
451- take n l
451+ take n l
452452 = [], n <= 0
453453 = [], l == []
454454 = hd l : take (n-1) (tl l);
@@ -463,7 +463,7 @@ takewhile fn l
463463 = hd l : takewhile fn (tl l), fn (hd l)
464464 = [];
465465
466- /* zip2 l1 l2: zip two lists together
466+ /* zip2 l1 l2: zip two lists together
467467 *
468468 * zip2 [1,2] ['a', 'b', 'c'] == [[1,'a'],[2,'b']]
469469 * zip2 :: [*] -> [**] -> [[*,**]]
0 commit comments