currying with quark
Mix.install([
{:quark, "~> 2.3"}
])
Section
import Quark.Curry
defmodule Session do
def create(a, b, c) do
"#{a} #{b} #{c}"
end
def apply_value(func, value) do
func.(value)
end
end
Session.create(1, 2, 3)
(&Session.create/3)
|> curry
|> then(& &1.(1))
|> then(& &1.(1))
|> then(& &1.(1))
(&Session.create/3)
|> curry
|> Session.apply_value(1)
|> Session.apply_value(2)
|> Session.apply_value(3)