-
-
Save Wilfred/b4456bab5fb4ba8d90a08b50949ab4b5 to your computer and use it in GitHub Desktop.
partial application in ocaml
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
(* Using Jane Street Core. *) | |
let iteri_every (items : 'a list) (funcs : (int -> 'a -> unit) list): unit = | |
List.iter funcs ~f:(fun f -> List.iteri items f) | |
(* Doesn't type check! *) | |
let iteri_every2 (items : 'a list) (funcs : (int -> 'a -> unit) list): unit = | |
List.iter funcs ~f:(List.iteri items) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment