<commit_before>defmodule Recurse do
  def loopy([head | tail]) do
    IO.puts "Head: #{head} Tail: #{inspect(tail)}"
    loopy(tail)
  end

  def loopy([]), do: IO.puts "Done!"
end

Recurse.loopy([1, 2, 3, 4, 5])<commit_msg>Recursing exercises: sum and triple<commit_after>defmodule Recurse do
  def sum([head | tail], total) do
    sum(tail, total + head)
  end

  def sum([], total), do: total

  def triple([head | tail], list) do
    triple(tail, list ++ [3 * head])
  end

  def triple([], list), do: list
end

IO.puts "Sum: #{Recurse.sum([1, 2, 3, 4, 5], 0)}"
IO.puts "Triple: " <> inspect Recurse.triple([1, 2, 3, 4, 5], [])
{'fraction_non_alphanumeric': 0.18858954041204437, 'fraction_numerical': 0.02694136291600634, 'mean_word_length': 3.7518796992481205, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '862730', 'n_tokens_mistral': 271, 'n_tokens_neox': 248, 'n_words': 77}