summaryrefslogtreecommitdiff
path: root/src/PureUtils.ml
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/PureUtils.ml5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/PureUtils.ml b/src/PureUtils.ml
index 8d3b5258..8a1c074d 100644
--- a/src/PureUtils.ml
+++ b/src/PureUtils.ml
@@ -399,6 +399,11 @@ let type_decl_is_enum (def : T.type_decl) : bool =
let mk_state_ty : ty = Adt (Assumed State, [])
let mk_result_ty (ty : ty) : ty = Adt (Assumed Result, [ ty ])
+let unwrap_result_ty (ty : ty) : ty =
+ match ty with
+ | Adt (Assumed Result, [ ty ]) -> ty
+ | _ -> failwith "not a result"
+
let mk_result_fail_texpression (ty : ty) : texpression =
let type_args = [ ty ] in
let ty = Adt (Assumed Result, type_args) in