Last active
December 26, 2018 16:59
-
-
Save mvaldesdeleon/646e90ac8a0d1e4138afedb25dcc160b 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
result = foo . bar . baz $ value | |
result1 = foo $ bar $ baz $ value | |
result2 = foo $ bar . baz $ value | |
result3 = foo (bar . baz $ value) | |
result4 = (foo . bar) (baz value) | |
result5 = foo . bar $ baz value | |
-- etc... | |
-- Challenge to the reader: Given n terms (where in these examples n = 3), | |
-- how many different ways are there to write the above expressions? | |
-- Can you produce them all? | |
-- | |
-- No single-term parens are allowed, e.g. (foo), since this would allow ((foo)), (((foo))), ... | |
-- and produce the trivial and boring solution of "Infinity" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment