tvl-depot/users/wpcarro/scratch/compiler/prettify.ml
William Carroll 1e9c3955bf refactor(wpcarro/compiler): Modularize debug fns
Define `debug.ml` and `prettify.ml` to clean-up some code.

Change-Id: Iee2e1ed666f2ccb5e56cc50054ca85b8ba513f3b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7078
Tested-by: BuildkiteCI
Reviewed-by: wpcarro <wpcarro@gmail.com>
2022-10-25 03:59:02 +00:00

9 lines
261 B
OCaml

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)