summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPrashanth Mundkur2018-11-26 15:50:37 -0800
committerPrashanth Mundkur2018-11-26 15:51:19 -0800
commitd48ccd801b4d99c160f289b2efdde10aa36e7bdd (patch)
treed094010c8a159308c5af83e36b70af427c0cf1a8 /src
parent20ed809845c4b62235d3cbe203ecaefead943ac8 (diff)
Use a temporary definition of List.init until 4.06 is more standard.
Diffstat (limited to 'src')
-rw-r--r--src/pretty_print_coq.ml7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/pretty_print_coq.ml b/src/pretty_print_coq.ml
index 841f21e6..cfffb8c9 100644
--- a/src/pretty_print_coq.ml
+++ b/src/pretty_print_coq.ml
@@ -1645,6 +1645,9 @@ let doc_exp, doc_let =
(* expose doc_exp and doc_let *)
in top_exp, let_exp
+(* FIXME: A temporary definition of List.init until 4.06 is more standard *)
+let list_init n f = Array.to_list (Array.init n f)
+
let types_used_with_generic_eq defs =
let rec add_typ idset (Typ_aux (typ,_)) =
match typ with
@@ -1748,7 +1751,7 @@ let doc_typdef generic_eq_types (TD_aux(td, (l, annot))) = match td with
let numfields = List.length fs in
let intros_pp s =
string " intros [" ^^
- separate space (List.init numfields (fun n -> string (s ^ string_of_int n))) ^^
+ separate space (list_init numfields (fun n -> string (s ^ string_of_int n))) ^^
string "]." ^^ hardline
in
let eq_pp =
@@ -1756,7 +1759,7 @@ let doc_typdef generic_eq_types (TD_aux(td, (l, annot))) = match td with
string "Instance Decidable_eq_" ^^ id_pp ^^ space ^^ colon ^/^
string "forall (x y : " ^^ id_pp ^^ string "), Decidable (x = y)." ^^
hardline ^^ intros_pp "x" ^^ intros_pp "y" ^^
- separate hardline (List.init numfields
+ separate hardline (list_init numfields
(fun n ->
let ns = string_of_int n in
string ("cmp_record_field x" ^ ns ^ " y" ^ ns ^ "."))) ^^