From 228119602c74d8a2add3fc1764a65fcba24acdae Mon Sep 17 00:00:00 2001 From: Georgiy Komarov Date: Mon, 23 Jan 2023 18:51:24 +0700 Subject: [PATCH] chore(type): Add docstrings to the type description --- src/base/Type.ml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/base/Type.ml b/src/base/Type.ml index 1cb68397f..a110d3b08 100644 --- a/src/base/Type.ml +++ b/src/base/Type.ml @@ -129,14 +129,18 @@ module type ScillaType = sig [@@deriving sexp] type t = - | PrimType of PrimType.t - | MapType of t * t + | PrimType of PrimType.t (** [PrimType(T)] represents a primary type *) + | MapType of t * t (** [MapType(K, V)] is a mapping type: [K |-> V] *) | FunType of t * t + (** [FunType(Ty1, Ty2)] is a function type: [Ty1 => Ty2] *) | ADT of loc TIdentifier.t * t list - | TypeVar of string + (** [ADT(N, Args)] represents ADT type [N] with type parameters [Args] *) + | TypeVar of string (** [TypeVar(T)] is a type variable *) | PolyFun of string * t - | Unit - | Address of t addr_kind + (** [PolyFun('A, T)] represents a polymorphic function type where + ['A] is a type parameter. For example: [forall 'A. List 'a -> List 'A] *) + | Unit (** [Unit] is a unit type *) + | Address of t addr_kind (** [Address(A)] represents address *) [@@deriving sexp, to_yojson] val pp_typ : t -> string