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

15 lines
380 B
OCaml
Raw Normal View History

type t =
| Var of Identifier.t
| Int
| Product of t * t
| Arrow of t * t
[@@deriving eq, ord, show]
2024-04-13 20:15:39 +02:00
2024-04-30 13:54:48 +02:00
(** string of Type *)
2024-04-13 20:15:39 +02:00
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 ^ ")"
;;