iter : (key -> 'a -> unit) -> 'a t -> unit
The function takes a function that takes a key, value, and updates some state, and then in the end you don't get anything back--just the updated state that lives somewhere else. Agh! I prefer to use Map.fold, which makes the state updating more explicit:
fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
No comments:
Post a Comment