diff options
author | Son Ho | 2022-01-06 11:20:38 +0100 |
---|---|---|
committer | Son Ho | 2022-01-06 11:20:38 +0100 |
commit | 6ef1bf7e2f1b7a0067169bf71860671f8b3f6bca (patch) | |
tree | 5fa397e413c70b5a20c2960db97f7f231fca7277 /src/ValuesUtils.ml | |
parent | 6a3faa82e09e3fbf23014b53a2b40d420bc70c9b (diff) |
Cleanup and reorganize
Diffstat (limited to 'src/ValuesUtils.ml')
-rw-r--r-- | src/ValuesUtils.ml | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ValuesUtils.ml b/src/ValuesUtils.ml index 488de15d..4a503a65 100644 --- a/src/ValuesUtils.ml +++ b/src/ValuesUtils.ml @@ -1,8 +1,14 @@ -module T = Types open TypesUtils +open Types open Values let mk_unit_value : typed_value = { value = Adt { variant_id = None; field_values = [] }; ty = mk_unit_ty } -let mk_typed_value (ty : T.ety) (value : value) : typed_value = { value; ty } +let mk_typed_value (ty : ety) (value : value) : typed_value = { value; ty } + +(** Box a value *) +let mk_box_value (v : typed_value) : typed_value = + let box_ty = mk_box_ty v.ty in + let box_v = Adt { variant_id = None; field_values = [ v ] } in + mk_typed_value box_ty box_v |