Created
December 14, 2017 16:11
-
-
Save baronfel/ae41b7162b26b5556eca9e163394ea2f to your computer and use it in GitHub Desktop.
Seq.reduce example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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