I am new to F # and approached this scenario and hoped that someone could explain why my compiler does not like code ...
If in F # I do the following ...
let FloatToInt = 10.0 |> int let IntToFloat = 10 |> float
Everything is in order and the number is passed to the corresponding data type ...
if, however, I do the following ...
let IntToBigInt = 10 |> bigint
I get the error "Invalid use of type name or object constructor". I assume this is because there is no operator overload for the direct channel for bigint?
If I wanted to make this code possible, how would I do it? I know I can use a different syntax, for example ...
let IntToBigInt = bigint(10)
But I really like the Forward Pipe syntax and would like to know if I can achieve it to ...
let IntToBigInt = 10 |> bigint
will work...
f #
Mark pearl
source share