Simplify Subtype.list_to_string

Reviewed By: jeremydubreil

Differential Revision: D4371339

fbshipit-source-id: 6c192f4
master
Josh Berdine 8 years ago committed by Facebook Github Bot
parent d29659177f
commit 5289ccfb23

@ -18,24 +18,12 @@ let module L = Logging;
let module F = Format;
let list_to_string list => {
let rec aux list =>
switch list {
| [] => ""
| [el, ...rest] =>
let s = aux rest;
if (s == "") {
Typename.name el
} else {
Typename.name el ^ ", " ^ s
}
};
if (IList.length list == 0) {
let list_to_string list =>
if (List.length list == 0) {
"( sub )"
} else {
"- {" ^ aux list ^ "}"
}
};
"- {" ^ String.concat sep::", " (List.map f::Typename.name list) ^ "}"
};
type t' =
| Exact /** denotes the current type only */

Loading…
Cancel
Save