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>
This commit is contained in:
William Carroll 2022-10-24 17:51:48 -04:00 committed by wpcarro
parent a8876a4cda
commit 1e9c3955bf
7 changed files with 91 additions and 85 deletions

View file

@ -0,0 +1,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)