let as_kind_env env =
let env = ref env in
let read id =
try
match Env.lookup (!env).type_info id with
| (k, _, _) -> k
with Not_found ->
raise (UnboundTypeConstructor (undefined_position, id))
in
let update i k =
env := add_type_variable (!env) i (k, variable Flexible ())
in
(read : tname -> KindInferencer.t),
(update : tname -> KindInferencer.t -> unit)