<jupyter_start><jupyter_text>Taken fron [coconut-lang.org](coconut-lang.org) pipeline-style programming<jupyter_code>"hello, world!" |> print<jupyter_output>hello, world!<jupyter_text>prettier lambdas<jupyter_code>x -> x ** 2<jupyter_output><empty_output><jupyter_text>partial application<jupyter_code>range(10) |> map$(pow$(?, 2)) |> list<jupyter_output><empty_output><jupyter_text>pattern-matching<jupyter_code>match [head] + tail in [0, 1, 2, 3]:
    print(head, tail)<jupyter_output>0 [1, 2, 3]<jupyter_text>destructuring assignment<jupyter_code>{"list": [0] + rest} = {"list": [0, 1, 2, 3]}<jupyter_output><empty_output><jupyter_text>infix notation<jupyter_code># 5 `mod` 3 == 2<jupyter_output><empty_output><jupyter_text>operator functions<jupyter_code>product = reduce$(*)<jupyter_output><empty_output><jupyter_text>function composition<jupyter_code># (f..g..h)(x, y, z)<jupyter_output><empty_output><jupyter_text>lazy lists<jupyter_code># (| first_elem() |) :: rest_elems()<jupyter_output><empty_output><jupyter_text>parallel programming<jupyter_code>range(100) |> parallel_map$(pow$(2)) |> list<jupyter_output><empty_output><jupyter_text>tail call optimization<jupyter_code>def factorial(n, acc=1):
    case n:
        match 0:
            return acc
        match _ is int if n > 0:
            return factorial(n-1, acc*n)<jupyter_output><empty_output><jupyter_text>algebraic data types<jupyter_code>data Empty()
data Leaf(n)
data Node(l, r)

def size(Empty()) = 0

addpattern def size(Leaf(n)) = 1

addpattern def size(Node(l, r)) = size(l) + size(r)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15766331658291458, 'fraction_numerical': 0.018844221105527637, 'mean_word_length': 8.051136363636363, 'pattern_counts': {'":': 2, '<': 47, '<?xml version=': 0, '>': 54, '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}}
{'chain_length': '12', 'dir': 'jupyter-structured-clean-dedup', 'id': '6006', 'license': 'MIT', 'n_tokens_mistral': 666, 'n_tokens_neox': 634, 'n_words': 92, 'path': 'tests/notebooks/ipynb_coconut/coconut_homepage_demo.ipynb', 'repo_name': 'Skylion007/jupytext', 'size': '1592'}