Fiddling type inference on number conversion
I've got a function which takes an input of type
('a * (float * 'b * float)) list
Where I'd obviously like to avoid having to explicitly include the type.
The problem is that I convert the second float to decimal, using the decimal function.
let v2 (_,(_,_,v)) = decimal v
So type 开发者_如何学编程inference defaults to seeing this:
('a * (float * 'b * int)) list
Is there anything clever I can do to avoid having to explicitly include the type signature of the function?
Is there something wrong with doing it like this?
let v2 (_,(_,_,v:float)) = decimal v
精彩评论