Skip to content

Instantly share code, notes, and snippets.

@baronfel
Created December 14, 2017 16:11
Show Gist options
  • Save baronfel/ae41b7162b26b5556eca9e163394ea2f to your computer and use it in GitHub Desktop.
Save baronfel/ae41b7162b26b5556eca9e163394ea2f to your computer and use it in GitHub Desktop.
Seq.reduce example
open System.Linq
let words = [ "I"; "am"; "a"; "dog"]
let aggSentence = words.Aggregate(fun sentence word -> word + " " + sentence)
let reduceSentence = words |> Seq.reduce (fun sentence word -> word + " " + sentence)
aggSentence = reduceSentence
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment