hubFS: THE place for F#

. . . are you on The Hub?
Welcome to hubFS: THE place for F# Sign in | Join | Help
in Search

Article Releases

  • Foundations of F#

    I'm delighted to formally announce that Apress will publish Rob Pickering's Foundations of F# in March 2007. This is the right book at the right time to bring F# to the world.

    Rob, with Don Syme as technical editor, is writing a comprehensive, clear, and concise introduction to F# and F# programming that experts will read with pleasure yet novices will easily understand.

    This is a book every F# programmer will find invaluable and an exciting moment in F# history!

    Visit Apress or, even better, preorder Foundations of F# from Amazon.

  • F#の入門

    F#はパソコン言語の一種で、関数型言語(かんすうがたげんご)と言われています。それは抽象化(ちゅうしょうか)的に関数を使うので、オブジェクト指向(しこう)言語のジャバとかC++などとは違います。始めて目にした時、F#の関数はジャバのメソッドとにとても似ていると思うだろう。

     

    F#                                                        ジャバ

     

    let square x = x * x          int square(int x) {
                                      return x * x;
                                  }

     

    しかしF#は上位関数型言語なので、関数は値にも使うことができます。たとえば、「map」は上位関数で、受け取り関数をリストの要素(ようそ)と呼びます:

     

    > map square [1; 2; 3; 4];;
    val it : int list = [1; 4; 9; 16]

     

    ここでは関数の「square」が引数されて使われます。「map」はF#で使うとても書きやすいです:

     

    let rec map f xs =
        match xs with
        | [] -> []
        | x::xs’ -> (f x) :: map f xs’

     

    ジャバで書くことはどんな上位関数でも難しいので、簡単な「map」でさえ(みじか)く、(わか)りやすく、そして容易(ようい)に書くことができません。一般的にはF#プログラムの長さはジャバの長さの十パーセントぐらいしかありません。

     

    F#の生まれについて

     

    2002年に、ケンブリッジにあるマイクロソフトの研究所で、情報工学者(じょうほうこうがくしゃ)のドン・サイム博士が、F#言語とコンパイラーを初めて作りました。最近ではF#が段々と人々に広まり一般的になりました。ヨーロッパでも、アメリカでも、アジアでも多くの科学者、学生、インベストメントアナリストもF#でプログラミングをしています。

This Blog

Post Calendar

<August 2008>
SuMoTuWeThFrSa
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456

Syndication

Powered by Community Server, by Telligent Systems