about summary refs log tree commit diff
path: root/users/wpcarro/scratch/compiler/prettify.ml
blob: 7903ad36947cb5f86fea5ad19ee871cfb6e1d21b (plain) (blame)
1
2
3
4
5
6
7
8
9
open Types

(* Pretty-print the type, t. *)
let rec type' (t : _type) : string =
  match t with
  | TypeInt -> "Integer"
  | TypeBool -> "Boolean"
  | TypeVariable k -> Printf.sprintf "%s" k
  | TypeArrow (a, b) -> Printf.sprintf "%s -> %s" (type' a) (type' b)