So I have the following code:
// Learn more about F# at http://fsharp.net
open System
open System.Linq
open Microsoft.
Pipelining supports F#'s left-to-right type inference. a.GroupBy requires that the type of a is already known to be seq<_>, whereas a |> Seq.groupBy itself infers a to be seq<_>. The following function:
let increment items = items |> Seq.map (fun i -> i + 1)
requires a type annotation to be written using LINQ:
let increment (items:seq<_>) = items.Select(fun x -> x + 1)
As you get comfortable with the functional style you'll find ways to make your code more concise. For example, the previous function can be shortened to:
let increment = Seq.map ((+) 1)