let variables_of_typ = 
  let rec vtyp acu = function
    | TypVar (_, TName x) -> 
        StringSet.add x acu

    | TypApp (_, t, ts) -> 
        List.fold_left vtyp (vtyp acu t) ts

    | TypRowCons (_, attributes, t) -> 
        List.fold_left vtyp (vtyp acu t) (assoc_proj2 attributes)

    | TypRowUniform (_, x) -> 
        vtyp acu x
  in
    vtyp StringSet.empty