Created
March 3, 2020 09:34
-
-
Save eqr/b85583eb779d76a470164cfcbf77440a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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