Powered by AppSignal & Oban Pro
Would you like to see your link here? Contact us

BOT

bot.livemd

BOT

import IEx.Helpers

Layers

Do fun things

Data functions tests

i([0])

Counter

input = "42"
String.to_integer(input)
defmodule Counter do
  def new(input) do
    String.to_integer(input)
  end

  def add(acc, i) do
    acc + i
  end

  def show(acc) do
    "The ants are is #{acc}"
  end
end
input
|> Counter.new()
|> Counter.add(1)
|> Counter.add(1)
|> Counter.add(-1)
|> Counter.show()
Counter.show(Counter.add(Counter.add(Counter.add(Counter.new(input), 1), 1), -1))