summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/PrintPure.ml13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/PrintPure.ml b/src/PrintPure.ml
index 8e19238c..8d07e5b1 100644
--- a/src/PrintPure.ml
+++ b/src/PrintPure.ml
@@ -264,3 +264,16 @@ let fun_sig_to_string (fmt : ast_formatter) (sg : fun_sig) : string =
in
let all_types = List.concat [ type_params; inputs; [ outputs ] ] in
String.concat " -> " all_types
+
+let inst_fun_sig_to_string (fmt : ast_formatter) (sg : inst_fun_sig) : string =
+ let ty_fmt = ast_to_type_formatter fmt in
+ let inputs = List.map (ty_to_string ty_fmt) sg.inputs in
+ let outputs = List.map (ty_to_string ty_fmt) sg.outputs in
+ let outputs =
+ match outputs with
+ | [] -> "()"
+ | [ out ] -> out
+ | outputs -> "(" ^ String.concat " * " outputs ^ ")"
+ in
+ let all_types = List.append inputs [ outputs ] in
+ String.concat " -> " all_types