Last active
July 27, 2018 08:44
-
-
Save KKostya/69b33259de6a5f0de0d5a5ae72cd9470 to your computer and use it in GitHub Desktop.
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
let rec foldi ~base ?(i=0) f l = | |
match l with | |
| [] -> base | |
| x :: tail -> f i x ( foldi f ~base ~i:(i+1) tail ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment