diff options
author | Son Ho | 2022-02-08 17:51:04 +0100 |
---|---|---|
committer | Son Ho | 2022-02-08 17:51:04 +0100 |
commit | 1e6f3fb7d8ac8e72ca38f08d7e4be5c835e3443a (patch) | |
tree | 5959874115481303a6f662ec4c1244307f1ee089 /src/Pure.ml | |
parent | b583d18a8336b137b445cc01b713767f354168f4 (diff) |
Make progress on implementing support for types and functions like
Option and Vec
Diffstat (limited to '')
-rw-r--r-- | src/Pure.ml | 22 |
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] |