3 ms·
Mathematica has a nice syntax for function application, mapping over lists, etc. It's also possible to define such operators in Haskell, which has the added ad
by xtacy 16y ago
Mathematica has a nice syntax for function application, mapping over lists, etc. It's also possible to define such operators in Haskell, which has the added advantage of type-safety.
f @ {1,2,3} == f[{1,2,3}]
f /@ list == map(f, list)
f @@ {1,2,3} == f[1,2,3]
(#1 * 2) /@ {1,2,3} == {2,4,6}
etc.
- ot 16y agoThat's like F# operator |> f |> g == g(f) [1 .. 3] |> Seq.map (fun x -> x * x) |> Seq.sum |> printfn "%A" // prints 14