let set_opt_attrs attrs obj =
    List.fold_left (fun o (n,v) -> o >>> set_opt_attr n v) obj attrs