<commit_before>import { LNil } from './types';

export var add = (...exprs) => exprs.reduce((acc, val) => acc + val);

export var divide = (...exprs) => exprs.reduce((acc, val) => acc / val);

export var multiply = (...exprs) => exprs.reduce((acc, val) => acc * val);

export var subtract = (...exprs) => exprs.reduce((acc, val) => acc - val);

export var lt = (a, b) => a < b;

export var lte = (a, b) => a <= b;

export var gt = (a, b) => a > b;

export var gte = (a, b) => a >= b;

export var first = (list) => list.length !== 0 ? list[0] : LNil();

export var rest = (list) => list.slice(1);

export var eq = (x, y) => x.valueOf() === y.valueOf();

export var list = (...elems) => elems;

export var cons = (a, b) => {
  if (!Array.isArray(b)) {
    throw new TypeError('Expected a list');
  }

  return [a, ...b];
};

export var type = (value) => value._type;<commit_msg>Prevent JS primitive from leaking into env via `type` function<commit_after>import { LNil, LString } from './types';

export var add = (...exprs) => exprs.reduce((acc, val) => acc + val);

export var divide = (...exprs) => exprs.reduce((acc, val) => acc / val);

export var multiply = (...exprs) => exprs.reduce((acc, val) => acc * val);

export var subtract = (...exprs) => exprs.reduce((acc, val) => acc - val);

export var lt = (a, b) => a < b;

export var lte = (a, b) => a <= b;

export var gt = (a, b) => a > b;

export var gte = (a, b) => a >= b;

export var first = (list) => list.length !== 0 ? list[0] : LNil();

export var rest = (list) => list.slice(1);

export var eq = (x, y) => x.valueOf() === y.valueOf();

export var list = (...elems) => elems;

export var cons = (a, b) => {
  if (!Array.isArray(b)) {
    throw new TypeError('Expected a list');
  }

  return [a, ...b];
};

export var type = (value) => LString(value._type);
{'fraction_non_alphanumeric': 0.22484881803188564, 'fraction_numerical': 0.003298515667949423, 'mean_word_length': 3.126984126984127, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 43, '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': '1814693', 'n_tokens_mistral': 684, 'n_tokens_neox': 673, 'n_words': 227}