13 lines
358 B
OCaml
13 lines
358 B
OCaml
type t =
|
|
| Var of Identifier.t
|
|
| Int
|
|
| Product of t * t
|
|
| Arrow of t * t
|
|
[@@deriving eq, ord, show]
|
|
|
|
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 ^ ")"
|
|
;;
|