Skip to content

Instantly share code, notes, and snippets.

@eqr
Created March 3, 2020 09:34
Show Gist options
  • Save eqr/b85583eb779d76a470164cfcbf77440a to your computer and use it in GitHub Desktop.
Save eqr/b85583eb779d76a470164cfcbf77440a to your computer and use it in GitHub Desktop.
defmodule Composition do
def inc(x) do
x + 1
end
def square(x) do
x * x
end
def double(x) do
x * 2
end
def composition(FILL_IN_1) do
FILL_IN_2
end
def isd do
FILL_IN_3
end
end
18 = Composition.isd.(2)
72 = Composition.isd.(5)
42 = Composition.composition([&Composition.double/1]).(21)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment