F# Units of measure - 'lifting' values to float

前端 未结 2 1193
别跟我提以往
别跟我提以往 2020-12-11 09:17

When importing numbers from a csv file, I need to convert them to floats with unit.

Currently I do this with an inline function:

data |> List.map          


        
2条回答
  •  情歌与酒
    2020-12-11 09:44

    Is there any reason why you have to map twice? What's wrong with this:

    data |> List.map (fun x -> (float x) * 1.0)
    

提交回复
热议问题