From c36a6cb41efa525a0d4d60d646b1e48b540306cc Mon Sep 17 00:00:00 2001 From: Vesa Karvonen Date: Sun, 29 Oct 2023 09:46:51 +0200 Subject: [PATCH] Constrain types to avoid weak variables in inferred types --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 484ed8d..dd6fe95 100644 --- a/README.md +++ b/README.md @@ -403,11 +403,11 @@ val filter : We can see `filter` does indeed work as expected. ```ocaml -# let var_list = to_var_list [2;3;5] -val var_list : _[> `Cons of int * 'a | `Nil ] Var.t as 'a = +# let var_list = (to_var_list [2;3;5] :> [ `Cons of _ | `Nil ] Var.t) +val var_list : [ `Cons of int * 'a | `Nil ] Var.t as 'a = -# let incr_list = to_incr_list var_list -val incr_list : _[> `Cons of int * 'a | `Nil ] t as 'a = +# let incr_list = (to_incr_list var_list :> [ `Cons of _ | `Nil ] t) +val incr_list : [ `Cons of int * 'a | `Nil ] t as 'a = # let res_list = filter (fun x -> x mod 2 = 1) incr_list