2011-02-17から1日間の記事一覧
リストの場合は再帰関数とパターンマッチングでできるんですが、シーケンスだとそうもいかず冗長になっちゃうなぁと思った。 リスト [<Test>] let ``detect last element of list`` () = let rec loop = function | [] -> () | [x] -> printfn "last %d" x | h :: </test>…
リストの場合は再帰関数とパターンマッチングでできるんですが、シーケンスだとそうもいかず冗長になっちゃうなぁと思った。 リスト [<Test>] let ``detect last element of list`` () = let rec loop = function | [] -> () | [x] -> printfn "last %d" x | h :: </test>…