method simple_ctyp =
fun f t ->
let () = o#node f t Ast.loc_of_ctyp
in
match t with
| Ast.TyId (_, i) -> o#ident f i
| Ast.TyAnt (_, s) -> o#anti f s
| Ast.TyAny _ -> pp f "_"
| Ast.TyLab (_, s, t) ->
pp f "@[<2>%s:@ %a@]" s o#simple_ctyp t
| Ast.TyOlb (_, s, t) ->
pp f "@[<2>?%s:@ %a@]" s o#simple_ctyp t
| Ast.TyObj (_, (Ast.TyNil _), Ast.RvNil) -> pp f "< >"
| Ast.TyObj (_, (Ast.TyNil _), Ast.RvRowVar) ->
pp f "< .. >"
| Ast.TyObj (_, t, Ast.RvRowVar) ->
pp f "@[<0>@[<2><@ %a;@ ..@]@ >@]" o#ctyp t
| Ast.TyObj (_, t, Ast.RvNil) ->
pp f "@[<0>@[<2><@ %a@]@ >@]" o#ctyp t
| Ast.TyQuo (_, s) -> pp f "'%a" o#var s
| Ast.TyRec (_, t) -> pp f "@[<2>{@ %a@]@ }" o#ctyp t
| Ast.TySum (_, t) -> pp f "@[<0>%a@]" o#sum_type t
| Ast.TyTup (_, t) -> pp f "@[<1>(%a)@]" o#ctyp t
| Ast.TyPkg (_, mt) ->
pp f "@[<2>(module@ %a@])" o#module_type mt
| Ast.TyVrnEq (_, t) ->
pp f "@[<2>[@ %a@]@ ]" o#sum_type t
| Ast.TyVrnInf (_, t) ->
pp f "@[<2>[<@ %a@]@,]" o#sum_type t
| Ast.TyVrnInfSup (_, t1, t2) ->
let (a, al) = get_ctyp_args t2 []
in
pp f "@[<2>[<@ %a@ >@ %a@]@ ]" o#sum_type t1
(list o#simple_ctyp "@ ") (a :: al)
| Ast.TyVrnSup (_, t) ->
pp f "@[<2>[>@ %a@]@,]" o#sum_type t
| Ast.TyCls (_, i) -> pp f "@[<2>#%a@]" o#ident i
| Ast.TyVrn (_, s) -> pp f "`%a" o#var s
| Ast.TySta (_, t1, t2) ->
pp f "%a *@ %a" o#simple_ctyp t1 o#simple_ctyp t2
| Ast.TyNil _ -> assert false
| t -> pp f "@[<1>(%a)@]" o#ctyp t