Created
January 13, 2014 16:24
-
-
Save zakki/8403141 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
| open Batteries | |
| open Deriving_Show | |
| module Show_batSet | |
| (O : Set.OrderedType) | |
| (K : Show with type a = O.t) | |
| : Show with type a = Set.Make(O).t = | |
| Defaults( | |
| struct | |
| module S = Set.Make(O) | |
| type a = S.t | |
| let format formatter set = | |
| Format.pp_open_box formatter 0; | |
| Format.pp_print_string formatter "{"; | |
| S.iter (fun elt -> | |
| Format.pp_open_box formatter 0; | |
| K.format formatter elt; | |
| Format.fprintf formatter ";@;"; | |
| Format.pp_close_box formatter (); | |
| ) set; | |
| Format.pp_print_string formatter "}"; | |
| Format.pp_close_box formatter (); | |
| end) | |
| module IntSet = struct | |
| include Set.Make(Int) | |
| module Show_t = Show_batSet(Int)(Show_int) | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment