<commit_before>
(def list-reverse' (list new-list)
     (match list
            Empty       new-list
            (Cons x xs) (list-reverse' xs (Cons x new-list))))

(def list-reverse (list)
     (list-reverse' list Empty))

(def list-foldr (f initial list)
     (match list
            Empty       initial
            (Cons x xs) (f x (list-foldr f initial xs))))

(def list-foldl (f initial list)
     (match list
            Empty       initial
            (Cons x xs) (list-foldl f (f x initial) xs)))


(def list-map (f list)
     (match list
            Empty       list
            (Cons x xs) (Cons (f x) (list-map f xs))))

(def list-filter (f list)
     (list-reverse
        (list-foldl (fn (x xs)
              (match (f x)
                     True  (Cons x xs)
                     False xs))
                    Empty
                    list)))
<commit_msg>Added list-concat<commit_after>
(def list-reverse' (list new-list)
     (match list
            Empty       new-list
            (Cons x xs) (list-reverse' xs (Cons x new-list))))

(def list-reverse (list)
     (list-reverse' list Empty))

(def list-foldr (f initial list)
     (match list
            Empty       initial
            (Cons x xs) (f x (list-foldr f initial xs))))

(def list-foldl (f initial list)
     (match list
            Empty       initial
            (Cons x xs) (list-foldl f (f x initial) xs)))


(def list-map (f list)
     (match list
            Empty       list
            (Cons x xs) (Cons (f x) (list-map f xs))))

(def list-filter (f list)
     (list-reverse
        (list-foldl (fn (x xs)
              (match (f x)
                     True  (Cons x xs)
                     False xs))
                    Empty
                    list)))

(def list-concat (a b)
     (match a
            Empty       b
            (Cons x xs) (Cons x (list-concat xs b))))
{'fraction_non_alphanumeric': 0.11099195710455764, 'fraction_numerical': 0.0, 'mean_word_length': 1.3266832917705735, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2852400', 'n_tokens_mistral': 606, 'n_tokens_neox': 558, 'n_words': 209}