Last active
November 12, 2020 04:35
-
-
Save dinocarl/b11c420284e8642556b2b21c8ab09c31 to your computer and use it in GitHub Desktop.
JS Scan function
This file contains hidden or 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
const apCh = (fn, accVal) => (item) => accVal = fn(accVal, item); | |
const scanr = curry((fn, acc, xs) => map( | |
apCh(fn, acc), | |
xs | |
)) | |
scanr(add, 0)( | |
[5,6,7,8] | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment