3 ms·
|> is a low priority operator, which forces evaluation to occur first on the left. [1; 2; 3] |> List.filter (fun a -> a < 3) |> List.sum is the same as List.su
by throwaway344 13y ago
|> is a low priority operator, which forces evaluation to occur first on the left.
[1; 2; 3] |> List.filter (fun a -> a < 3) |> List.sum
is the same as
List.sum (List.filter (fun a -> a < 3) [1; 2; 3])
arg |> func is the same as func (arg)
- thinkpad20 13y agoYeah, that's exactly what I thought. It doesn't explain (or I don't see it yet) why the first example he gave wouldn't compile, but the second would.