Set.map #6279
Closed
Set.map #6279
Comments
Comment author: braibant Also, in the same vein, I find myself writing a "of_list" function quite often module MSet = struct I agree that this is a one-liner, but a frequent one... |
Comment author: @alainfrisch @braibant: Set.of_list has already been added to trunk (will be available in OCaml 4.02), with a somewhat optimized implementation. See #4986. |
Comment author: @damiendoligez May I remind everyone that the best place for such functions is "extended" libraries like Batteries and Jane Street Core? |
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Original bug ID: 6279
Reporter: @dbuenzli
Assigned to: @gasche
Status: resolved (set by @alainfrisch on 2016-12-06T18:37:19Z)
Resolution: fixed
Priority: normal
Severity: feature
Version: 4.01.0
Target version: 4.03.1+dev
Fixed in version: 4.04.0
Category: standard library
Bug description
would be nice. I have already written the following a few times in my life:
module Sset = Set.Make(String)
let sset_map f s = Sset.fold (fun e acc -> Sset.add (f e) acc) s Sset.empty
Thanks.
The text was updated successfully, but these errors were encountered: