Created
February 24, 2014 14:57
-
-
Save chomado/9189807 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
(* 目的: init から始めてlstの要素を右から順にfを施し込む *) | |
(* fold_right: ('a -> 'b -> 'b) -> 'a list -> 'b -> 'b *) | |
let rec fold_right f lst init = match lst with | |
[] -> init | |
| first :: rest -> f first (fold_right f rest init) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment