Skip to content
This repository was archived by the owner on Apr 24, 2021. It is now read-only.

Commit 0d74069

Browse files
committed
Use existing functions to convert to string.
1 parent 79b81f5 commit 0d74069

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed
Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
11
let printExpr = typ => {
2-
try(
3-
Res_outcome_printer.printOutType(
4-
Format.str_formatter,
5-
Printtyp.tree_of_typexp(false, typ),
6-
)
7-
) {
8-
| _ => Format.fprintf(Format.str_formatter, "Unable to print type")
9-
};
10-
Format.flush_str_formatter();
2+
Res_doc.toString(
3+
~width=60,
4+
Res_outcome_printer.printOutTypeDoc(Printtyp.tree_of_typexp(false, typ)),
5+
);
116
};
127

138
let printDecl = (~recStatus, name, decl) => {
14-
try(
15-
Res_outcome_printer.printOutSigItem(
16-
Format.str_formatter,
9+
Res_doc.toString(
10+
~width=60,
11+
Res_outcome_printer.printOutSigItemDoc(
1712
Printtyp.tree_of_type_declaration(Ident.create(name), decl, recStatus),
18-
)
19-
) {
20-
| _ => Format.fprintf(Format.str_formatter, "Unable to print type")
21-
};
22-
Format.flush_str_formatter();
13+
),
14+
);
2315
};

0 commit comments

Comments
 (0)