let asFunction l = fun i -> try (List.nth l i) with _ -> i