let rec string_of_type = function
| Integer -> "integer"
| Boolean -> "boolean"
| Pointer t -> "^" ^ (string_of_type t)
| User_type t -> t
| Unit -> "unit"
| Array(t, _, _) -> "array [" ^ (string_of_type t) ^ "]"
| Record l -> (List.fold_left (fun s (n, t) -> s ^ " " ^ n ^ " (" ^ (string_of_type t) ^ ")") "record [" l) ^ "]"
| Type_type -> "type"
| Unknown_type -> "???"