let as_obj x = match extract x with Obj o -> o | _ -> failwith "as_obj"