1
0
Fork 0
This repository has been archived on 2024-05-03. You can view files and clone it, but cannot push or open issues or pull requests.
unification-pfa/lib/type.ml
2024-04-30 13:54:48 +02:00

14 lines
380 B
OCaml

type t =
| Var of Identifier.t
| Int
| Product of t * t
| Arrow of t * t
[@@deriving eq, ord, show]
(** string of Type *)
let rec string_of_type = function
| Var v -> "Var '" ^ v ^ "'"
| Int -> "Int"
| Product (a, b) -> "Product(" ^ string_of_type a ^ ", " ^ string_of_type b ^ ")"
| Arrow (a, b) -> "Arrow(" ^ string_of_type a ^ ", " ^ string_of_type b ^ ")"
;;