I have these two pieces of code:
[| 0 .. N-1 |] |> Array.map((<<<)1)
[| 0 .. N-1 |] |> Array.map((*)2)
I thought they do absolutely the same things but they don't.
In first case I get 1, 2, 4 and in second - 0, 2, 4. I don't understand why there is 1 in the first case? If I write let a = 0 <<< 1, I get 0. Is this a bug?
Thanks!
The arguments are not in the order you think, they are the other way around.
Compare it with:
let a = 1 <<< 0 // this is equivalent to ((<<<)1) 0
The first argument after the parenthesized operator is the left argument, not the right.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With