4 ms·
Here's where F# shines - you could write your query like: products |> Seq.filter(fun a -> a.Type = ProductType.Bean) |> Seq.sortBy(fun a -> a.Group, a.Name)
by balakk 12y ago
Here's where F# shines - you could write your query like:
products
|> Seq.filter(fun a -> a.Type = ProductType.Bean)
|> Seq.sortBy(fun a -> a.Group, a.Name)
|> Seq.map(fun a -> a.Name)
It doesn't save a lot of lines here, but the big difference is this: suddenly you aren't constrained by the syntax of the single Linq query. So you want an additional filter,join,merge happening in between? No problem!
- virtualwhys 12y agoPretty noisy. Instead of: products |> Seq.filter(fun a -> a.foo =...) In another language you can do: products.filter(_.foo =...) Those `|> Seq...(fun a ->` all over the place look Java-ish ;-)
- CmonDev 12y agoThey had to deal with the OCAML baggage instead of starting from scratch.