Skip to content

Instantly share code, notes, and snippets.

@micahasmith
Created July 30, 2014 21:00
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save micahasmith/08bc833ad5151abc92b5 to your computer and use it in GitHub Desktop.
help.fs
let greetings = ["hi";"hello";]
let names = ["john";"micah";]
// trying to end up with ["hi john";"hi micah";"hello john"; "hello micah;"]
// cant use zip-- real life items arent same size
greetings
|> List.fold (fun(accum,greet) -> names |> List.map (fun (name)-> greet +" "+ name) |> List.append accum ) List.empty<string>;;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment