Created
August 25, 2016 09:16
-
-
Save anonymous/ce1f6f96ab48c15b7d7c48629db21dd1 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
lambda do |fn| | |
lambda { |x| x.call(x) }.call( | |
lambda do |myself| | |
lambda do |arg| | |
fn.call(arg, myself.call(myself)) | |
end | |
end | |
) | |
end.call( | |
# The lambda we wish to make recursive | |
lambda do |arg, recurse| | |
arg.kind_of?(Numeric) ? arg : arg.map { |item| recurse.call(item) }.inj\ | |
ect(&:+) | |
end | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment