Skip to content

Instantly share code, notes, and snippets.

@masaru-b-cl
Last active December 26, 2015 09:39
Show Gist options
  • Select an option

  • Save masaru-b-cl/7131490 to your computer and use it in GitHub Desktop.

Select an option

Save masaru-b-cl/7131490 to your computer and use it in GitHub Desktop.
[1,2,3] から{0 => 1, 1 => 2, 3 => 2} を作りたい in F#
// 「F# Interactive」での実行結果
> [1; 2; 3]
- |> Seq.mapi (fun i x -> (i, x))
- |> Map.ofSeq
- ;;
val it : Map<int,int> = map [(0, 1); (1, 2); (2, 3)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment