<commit_before>module Prelude (src) where

src = "

(let id (\\x x)

(let always (\\(x _) x)

(let compose (\\(f g) (\\x (f (g x))))

(let fst (\\[x|_] x)

(letrec len (\\xs (case xs ([] 0) ([_ | xs1] (+ 1 (len xs1)))))

(letrec map (\\(f xs)
  (case xs ([] []) ([hd|tl] [(f hd)|(map f tl)])))

(letrec map2 (\\(f xs ys)
  (case [xs ys]
    ([[x|xs1] [y|ys1]] [ (f x y) | (map2 f xs1 ys1) ])
    (_                 [])))

(letrec foldl (\\(f acc xs)
  (case xs ([] acc) ([x|xs1] (foldl f (f x acc) xs1))))

(letrec foldr (\\(f acc xs)
  (case xs ([] acc) ([x|xs1] (f x (foldr f acc xs1)))))

(letrec append (\\(xs ys)
  (case xs ([] ys) ([x|xs1] [ x | (append xs1 ys)])))

(let concat (foldr append [])

(let concatMap (\\(f xs) (concat (map f xs)))

(let cartProd (\\(xs ys)
  (concatMap (\\x (map (\\y [x y]) ys)) xs))

(let zip (map2 (\\(x y) [x y]))

(let nil  []
(let cons (\\(x xs) [x | xs])
(let snoc (\\(x ys) (append ys [x]))
(let hd   (\\[x|xs] x)
(let tl   (\\[x|xs] xs)

(let reverse (foldl cons nil)

(letrec range (\\(i j)
  (if (< i (+ j 1))
      (cons i (range (+ i 1) j))
      nil))

(let list0N
  (letrec foo (\\i (if (< i 0) nil (cons i (foo (- i 1)))))
  (compose reverse foo))

(let list1N (\\n (range 1 n))

(let repeat (\\(n x) (map (always x) (range 1 n)))

(letrec intermingle (\\(xs ys)
  (case [xs ys]
    ([[x|xs1] [y|ys1]] (cons x (cons y (intermingle xs1 ys1))))
    ([[]      []]      nil)
    (_                 (append xs ys))))

(letrec mult (\\(m n)
  (if (< m 1) 0 (+ n (mult (+ m -1) n))))

(let minus (\\(x y) (+ x (mult y -1)))

(letrec div (\\(m n)
  (if (< m n) 0
  (if (< n 2) m
    (+ 1 (div (minus m n) n)))))

(let neg (\\x (- 0 x))

(let not (\\b (if b false true))

(let clamp (\\(i j n) (if (< n i) i (if (< j n) j n)))

(let joinStrings (\\(sep ss)
  (foldr (\\(str acc) (if (= acc '') str (+ str (+ sep acc)))) '' ss))

;
; SVG Manipulating Functions
;

(let circle (\\(fill x y r)
  ['circle'
     [['cx' x] ['cy' y] ['r' r] ['fill' fill]]
     []])

(let ring (\\(c w x y r)
  ['circle'
     [ ['cx' x] ['cy' y] ['r' r] ['fill' 'none'] ['stroke' c] ['strokeWidth' w] ]
     []])

(let ellipse (\\(fill x y rx ry)
  ['ellipse'
     [ ['cx' x] ['cy' y] ['rx' rx] ['ry' ry] ['fill' fill] ]
     []])

(let rect (\\(fill x y w h)
  ['rect'
     [ ['x' x] ['y' y] ['width' w] ['height' h] ['fill' fill] ]
     []])

(let square (\\(fill x y side) (rect fill x y side side))

(let line (\\(fill w x1 y1 x2 y2)
  ['line'
     [ ['x1' x1] ['y1' y1] ['x2' x2] ['y2' y2] ['stroke' fill] ['strokeWidth' w] ]
     []])

(let polygon (\\(fill stroke w pts)
  ['polygon'
     [ ['fill' fill] ['points' pts] ['stroke' stroke] ['strokeWidth' w] ]
     []])

(let polyline (\\(fill stroke w pts)
  ['polyline'
     [ ['fill' fill] ['points' pts] ['stroke' stroke] ['strokeWidth' w] ]
     []])

(let path (\\(fill stroke w d)
  ['path'
     [ ['fill' fill] ['stroke' stroke] ['strokeWidth' w] ['d' d] ]
     []])<commit_msg>'strokeWidth' to 'stroke-width' to appease svgedit<commit_after>module Prelude (src) where

src = "

(let id (\\x x)

(let always (\\(x _) x)

(let compose (\\(f g) (\\x (f (g x))))

(let fst (\\[x|_] x)

(letrec len (\\xs (case xs ([] 0) ([_ | xs1] (+ 1 (len xs1)))))

(letrec map (\\(f xs)
  (case xs ([] []) ([hd|tl] [(f hd)|(map f tl)])))

(letrec map2 (\\(f xs ys)
  (case [xs ys]
    ([[x|xs1] [y|ys1]] [ (f x y) | (map2 f xs1 ys1) ])
    (_                 [])))

(letrec foldl (\\(f acc xs)
  (case xs ([] acc) ([x|xs1] (foldl f (f x acc) xs1))))

(letrec foldr (\\(f acc xs)
  (case xs ([] acc) ([x|xs1] (f x (foldr f acc xs1)))))

(letrec append (\\(xs ys)
  (case xs ([] ys) ([x|xs1] [ x | (append xs1 ys)])))

(let concat (foldr append [])

(let concatMap (\\(f xs) (concat (map f xs)))

(let cartProd (\\(xs ys)
  (concatMap (\\x (map (\\y [x y]) ys)) xs))

(let zip (map2 (\\(x y) [x y]))

(let nil  []
(let cons (\\(x xs) [x | xs])
(let snoc (\\(x ys) (append ys [x]))
(let hd   (\\[x|xs] x)
(let tl   (\\[x|xs] xs)

(let reverse (foldl cons nil)

(letrec range (\\(i j)
  (if (< i (+ j 1))
      (cons i (range (+ i 1) j))
      nil))

(let list0N
  (letrec foo (\\i (if (< i 0) nil (cons i (foo (- i 1)))))
  (compose reverse foo))

(let list1N (\\n (range 1 n))

(let repeat (\\(n x) (map (always x) (range 1 n)))

(letrec intermingle (\\(xs ys)
  (case [xs ys]
    ([[x|xs1] [y|ys1]] (cons x (cons y (intermingle xs1 ys1))))
    ([[]      []]      nil)
    (_                 (append xs ys))))

(letrec mult (\\(m n)
  (if (< m 1) 0 (+ n (mult (+ m -1) n))))

(let minus (\\(x y) (+ x (mult y -1)))

(letrec div (\\(m n)
  (if (< m n) 0
  (if (< n 2) m
    (+ 1 (div (minus m n) n)))))

(let neg (\\x (- 0 x))

(let not (\\b (if b false true))

(let clamp (\\(i j n) (if (< n i) i (if (< j n) j n)))

(let joinStrings (\\(sep ss)
  (foldr (\\(str acc) (if (= acc '') str (+ str (+ sep acc)))) '' ss))

;
; SVG Manipulating Functions
;

(let circle (\\(fill x y r)
  ['circle'
     [['cx' x] ['cy' y] ['r' r] ['fill' fill]]
     []])

(let ring (\\(c w x y r)
  ['circle'
     [ ['cx' x] ['cy' y] ['r' r] ['fill' 'none'] ['stroke' c] ['stroke-width' w] ]
     []])

(let ellipse (\\(fill x y rx ry)
  ['ellipse'
     [ ['cx' x] ['cy' y] ['rx' rx] ['ry' ry] ['fill' fill] ]
     []])

(let rect (\\(fill x y w h)
  ['rect'
     [ ['x' x] ['y' y] ['width' w] ['height' h] ['fill' fill] ]
     []])

(let square (\\(fill x y side) (rect fill x y side side))

(let line (\\(fill w x1 y1 x2 y2)
  ['line'
     [ ['x1' x1] ['y1' y1] ['x2' x2] ['y2' y2] ['stroke' fill] ['stroke-width' w] ]
     []])

(let polygon (\\(fill stroke w pts)
  ['polygon'
     [ ['fill' fill] ['points' pts] ['stroke' stroke] ['stroke-width' w] ]
     []])

(let polyline (\\(fill stroke w pts)
  ['polyline'
     [ ['fill' fill] ['points' pts] ['stroke' stroke] ['stroke-width' w] ]
     []])

(let path (\\(fill stroke w d)
  ['path'
     [ ['fill' fill] ['stroke' stroke] ['stroke-width' w] ['d' d] ]
     []])
{'fraction_non_alphanumeric': 0.2659289067739772, 'fraction_numerical': 0.01643192488262911, 'mean_word_length': 2.4202981651376145, 'pattern_counts': {'":': 0, '<': 17, '<?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': '4391161', 'n_tokens_mistral': 2822, 'n_tokens_neox': 2699, 'n_words': 931}