<commit_before>let {dedent} = require('./helpers')

/* eslint-disable max-len */
module.exports = [{
  name: 'Basics',
  code: dedent(`
    ; This example is not intend to be a tutorial nor an introduction to λ Calculus.
    ; You should check http://en.wikipedia.org/wiki/Lambda_calculus for that :)
    ; As you can see, these are comments. You can run this example clicking the Run
    ; button below or pressing Ctrl+Enter.
    ; So, the three basic types of λ expressions are:
    ; Variables:
    x
    ; Applications:
    x y
    ; And lambda abstractions (also known as functions):
    λx.x
    ; If the left-side of an application is an abstraction, then a reduction takes place:
    (λx.x) y
    ; That little abstraction at the left is the identity, a very simple function that
    ; just reduces to whatever you apply to it. We can give it a name like so:
    id = λx.x
    ; And then just refer it by that name:
    id a
    ; You can apply any kind of λ expression to an abstraction, like another function:
    id λb.c
    ; Or an application:
    id (x y)
    ; Or even the identity function itself:
    id id
    ; That means you can apply identity to itself as many times as you want and it'll still
    ; be identity:
    id id id id id
    ; Notice that applications are left-associative, so the line above is equivalent to:
    ((((id id) id) id) id)

    ; TODO: explain applicative and normal order...
  `),
}, {
  name: 'Booleans',
  code: dedent(`
    ; Church booleans

    ; The booleans and their operations can be encoded as the following λ-terms:
    true = λt.λf.t
    false = λt.λf.f
    not = λp.p false true
    and = λp.λq.p q p
    or = λp.λq.p p q
    if = λp.p

    ; Print truth tables for not, and and or:
    not true
    not false
    and false false
    and false true
    and true false
    and true true
    or false false
    or false true
    or true false
    or true true

    ; Terms can be nested as much as we want:
    if (not not false) (or false (if true true false)) false

    ; There's nothing special about "operators", we can treat them as any other value:
    (if false or and) true false
  `),
}, {
  name: 'Numbers',<commit_msg>Fix booleans example<commit_after>let {dedent} = require('./helpers')

/* eslint-disable max-len */
module.exports = [{
  name: 'Basics',
  code: dedent(`
    ; This example is not intend to be a tutorial nor an introduction to λ Calculus.
    ; You should check http://en.wikipedia.org/wiki/Lambda_calculus for that :)
    ; As you can see, these are comments. You can run this example clicking the Run
    ; button below or pressing Ctrl+Enter.
    ; So, the three basic types of λ expressions are:
    ; Variables:
    x
    ; Applications:
    x y
    ; And lambda abstractions (also known as functions):
    λx.x
    ; If the left-side of an application is an abstraction, then a reduction takes place:
    (λx.x) y
    ; That little abstraction at the left is the identity, a very simple function that
    ; just reduces to whatever you apply to it. We can give it a name like so:
    id = λx.x
    ; And then just refer it by that name:
    id a
    ; You can apply any kind of λ expression to an abstraction, like another function:
    id λb.c
    ; Or an application:
    id (x y)
    ; Or even the identity function itself:
    id id
    ; That means you can apply identity to itself as many times as you want and it'll still
    ; be identity:
    id id id id id
    ; Notice that applications are left-associative, so the line above is equivalent to:
    ((((id id) id) id) id)

    ; TODO: explain applicative and normal order...
  `),
}, {
  name: 'Booleans',
  code: dedent(`
    ; Church booleans

    ; The booleans and their operations can be encoded as the following λ-terms:
    true = λt.λf.t
    false = λt.λf.f
    not = λp.p false true
    and = λp.λq.p q p
    or = λp.λq.p p q
    if = λp.p

    ; Print truth tables for not, and and or:
    not true
    not false
    and false false
    and false true
    and true false
    and true true
    or false false
    or false true
    or true false
    or true true

    ; Terms can be nested as much as we want:
    if (not (not true)) (or false (if true true false)) false

    ; There's nothing special about "operators", we can treat them as any other value:
    (if false or and) true false
  `),
}, {
  name: 'Numbers',
{'fraction_non_alphanumeric': 0.07702825888787602, 'fraction_numerical': 0.0, 'mean_word_length': 2.4640883977900554, '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': '2526165', 'n_tokens_mistral': 1378, 'n_tokens_neox': 1315, 'n_words': 643}