let as_float x = match extract x with Num f -> f | _ -> failwith "as_float"