summaryrefslogtreecommitdiff
path: root/src/Pure.ml
diff options
context:
space:
mode:
authorSon Ho2022-02-08 17:51:04 +0100
committerSon Ho2022-02-08 17:51:04 +0100
commit1e6f3fb7d8ac8e72ca38f08d7e4be5c835e3443a (patch)
tree5959874115481303a6f662ec4c1244307f1ee089 /src/Pure.ml
parentb583d18a8336b137b445cc01b713767f354168f4 (diff)
Make progress on implementing support for types and functions like
Option and Vec
Diffstat (limited to '')
-rw-r--r--src/Pure.ml22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/Pure.ml b/src/Pure.ml
index c773d613..d706a366 100644
--- a/src/Pure.ml
+++ b/src/Pure.ml
@@ -20,21 +20,23 @@ module VarId = IdGen ()
type integer_type = T.integer_type [@@deriving show, ord]
-type assumed_ty =
- | Result
- (** The assumed types for the pure AST.
-
- In comparison with CFIM:
- - we removed `Box` (because it is translated as the identity: `Box T == T`)
- - we added `Result`, which is the type used in the error monad. This allows
- us to have a unified treatment of expressions.
- *)
-[@@deriving show, ord]
+(** The assumed types for the pure AST.
+
+ In comparison with CFIM:
+ - we removed `Box` (because it is translated as the identity: `Box T == T`)
+ - we added `Result`, which is the type used in the error monad. This allows
+ us to have a unified treatment of expressions.
+ *)
+type assumed_ty = Result | Vec | Option [@@deriving show, ord]
let result_return_id = VariantId.of_int 0
let result_fail_id = VariantId.of_int 1
+let option_some_id = T.option_some_id
+
+let option_none_id = T.option_none_id
+
type type_id = AdtId of TypeDefId.id | Tuple | Assumed of assumed_ty
[@@deriving show, ord]