Created
October 28, 2016 11:33
-
-
Save yurifrl/daed8e2ffe82a96e711f585b5cbcb954 to your computer and use it in GitHub Desktop.
example of pattern maching
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
// taken from http://blog.mgechev.com/2013/01/21/functional-programming-with-javascript/ | |
const $ = fun.parameter | |
const fact = fun( | |
[0, function () { return 1; }], | |
[$, function (n) { return n * fact(n - 1); }] | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment