SlideShare a Scribd company logo
1 of 98
Download to read offline
F#

   bleis-tift


August 28, 2011
F#
      F#
NParsec    FParsec
F#
F#




OCaml

.NET Framework
F#
F#
cons
1 3
[1; 2; 3]
[1..3]
1::2::3::[]
1::2::[3]
[ 1
  2
  3 ]
cons
cons
cons
cons
cons
cons
let xs = [2..10]
let ys = 1::xs
int   string   int * string
1
let x, y = 10, 20
printfn "%A" (x, y) // => (10, 20)

             2
let (x,   y) as tpl = 1,   2
printfn   "%A" tpl         // => (1, 2)
printfn   "%A" (x, y)      // => (1, 2)
printfn   "(%d, %d)" x y   // => (1, 2)
let [x;   y] as lst = [1; 2]
printfn   "%A" lst       // => [1; 2]
printfn   "%A" [x; y]    // => [1; 2]
printfn   "[%d; %d]" x y // => [1; 2]


warning FS0025:
            ’[_;_;_]’
1
1
1
2



(2, "hoge") // int * string


//
[2; "hoge"]

[box 1; box "hoge"] // obj list
2
//     ,
let p = "       ", 21


type Person = {
  Name: string
  Age: int
}
let p = { Name = "       "; Age = 21 }

                     4
F#


type Person(name: string, age: int) =
  member this.Name = name
  member this.Age = age
let p = Person("        ", 21)


type Person = { Name: string; Age: int }
let p = { Name = "       "; Age = 21 }
type Person(name: string, age: int) =
  member x.Name = name
  member x.Age = age
let f p = p.Name


error FS0072:
type Person = { Name: string; Age: int }
let f p = p.Name


type Person =
  {Name: string;
   Age: int;}
val f : Person -> string
(   )
(enum)
HtmlElem
C#


public abstract class HtmlElem {}
public class Heading : HtmlElem {
  public int Level { get; private set; }
  public string Text { get; private set; }
  public Heading(int level, string txt) {
    Level = level; Text = txt; } }
public class Text : HtmlElem {
  public string Text { get; private set; }
  public Text(string txt) {
    Text = txt; } }
public class HorizontalLine : HtmlElem {}
F#




type HtmlElem =
| Text of string
| Heading of int * string
| HorizontalLine
Equals

GetHashCode
Make static analyzers happy
==           !=




ToString
sprintf ”%A”
F#




F#
     C#
HtmlElem HTML
type HtmlElem =
| Heading of int * string
| Text of string
| HorizontalLine

let toHtmlStr elem =
  let h lv s =
    sprintf "<h%d>%s</h%d>" lv s lv
  match elem with
  | Heading(level, txt) -> h level txt
  | Text txt -> "<p>" + txt + "</p>"
  | HorizontalLine -> "<hr/>"
                    match
let add =   function
| 0, y ->   y
| x, 0 ->   x
| x, y ->   x + y
                       function
match     function


match
let add tpl =
  match tpl with
  | x, y -> x + y

function
let add = function
| x, y -> x + y
type t = { Tag: int; Value: int }
let value { Value = v } = v
match

match
let add tpl =
  match tpl with
  | x, y -> x + y

function
let add = function
| x, y -> x + y


let add (x, y) = x + y
Person
type Name = {
  FirstName: string
  LastName: string
}
type Person = { Name: Name; Age: int }

let f x =
  let { Name = { FirstName = fn } } = x
  fn
F#
Maybe
type MaybeBuilder() =
  member this.Bind(x, f) =
    x |> Option.bind f
  member this.Return(x) = Some x
let maybe = MaybeBuilder()

let plus   db = maybe {
  let! x   = db |> Map.tryFind "x"
  let! y   = db |> Map.tryFind "y"
  return   x + y
}
Map-Reduce   ( )




fold    reduce
fold
fold   reduce




fold   reduce
F#

fold reduce
> List.fold;;
val it : ((’a -> ’b -> ’a) -> ’a -> ’b list -> ’a)
 = <fun:clo@1>
> List.reduce;;
val it : ((’a -> ’a -> ’a) -> ’a list -> ’a)
 = <fun:clo@2-1>


fold

reduce                   list
                  list
fold
fold
fold
fold
fold



fold
sum
forall
map
filter
fold



fold
sum
forall
map
filter
fold    sum




sum
let sum xs =
  List.fold (+) 0 xs
fold     forall



forall
let forall p xs =
   xs
   |> List.fold (fun acc x -> acc && (p x)) true



exists
fold   map


map
let map f xs =
  ([], xs)
  ||> List.fold (fun acc x ->
        acc @ [f x]
      )
fold   filter


filter
let filter p xs =
  ([], xs)
  ||> List.fold begin acc x ->
        if p x then acc @ [x]
        else acc
      end
fold


fold

       fold(   unfold)
                         fold
F#
F#
F#
     .NET
F#



        F#
.NET Framework
.NET Framework



                       2.0
             .NET Framework


                  F#
.NET Framework


   F# .NET Framework2.0
   Runtime
   .NET Framework2.0   LINQ
       F #   List



.NET Framework           2.0   F#
.NET Framework

                  4.0                 F#
       TDDBC Tokyo 1.6

              C#        (         )
           KeyValueTime.cs       42
           SystemClock.cs        30
           TddbcKeyValueStore.cs 67

             F#       (          )
             KeyValueStore.fs 48

C#   139             F#   48
.NET Framework

                   4.0                 F#
        TDDBC Tokyo 1.6

           C#        (            )
     KeyValueTimeTest.cs       141
     SystemClockTest.cs        34
     TddbcKeyValueStoreTest.cs 346      ( )

           F#        (             )
            KeyValueStore.fs 170

C#   521           F#     170
.NET Framework




.NET Framework        F#

           2.0   C#
      F#
F#

.NET        F#

   option
F#   C#
VB
.NET



C#   VB
F#   list    F#     dll



            array   seq
static

NewHoge
                        Tag
                          IsHoge



          F#
module Hoge
let plus10 = ((+)10)
       Hoge.plus10
        FSharp.Core.FSharpFunc
                       FSharp.Core.dll
NParsec   FParsec
yacc       lex
       yacc lex
BNF
parsec
JParsec
NParsec
FParsec
scala.util.parsing
Boost.Spirit
NParsec



parsec    .NET
C#
                           C#

          Java
Scanner
FParsec




parsec   .NET
F#
NParsec   FParsec
NParsec


var lazyexpr = new Parser<double>[1];
var plazyexpr = Parsers.Lazy<double>(() =>
  lazyexpr[0]
);
var pterm =
  plazyexpr.Between(popen, pclose) | pnum;
var pexpr = ...
lazyexpr[0] = pexpr;
FParsec


let pexpr, exprref =
  createParserForwardedToRef()
let pterm =
      pexpr |> between popen pclose
  <|> pnum
do exprref := ...
F#   10   C#    54

     C#
           Visitor
C#
F#
NParsec         Bind
return Parsers.Return(...)
FParsec
NParsec
F#



     FParsec

               F#

More Related Content

What's hot

Elixirと他言語の比較的紹介 ver.2
Elixirと他言語の比較的紹介ver.2Elixirと他言語の比較的紹介ver.2
Elixirと他言語の比較的紹介 ver.2Tsunenori Oohara
 
Nervesが開拓する「ElixirでIoT」の新世界
Nervesが開拓する「ElixirでIoT」の新世界Nervesが開拓する「ElixirでIoT」の新世界
Nervesが開拓する「ElixirでIoT」の新世界Hideki Takase
 
PHP の GC の話
PHP の GC の話PHP の GC の話
PHP の GC の話y-uti
 
何となく勉強した気分になれるパーサ入門
何となく勉強した気分になれるパーサ入門何となく勉強した気分になれるパーサ入門
何となく勉強した気分になれるパーサ入門masayoshi takahashi
 
多倍長整数の乗算と高速フーリエ変換
多倍長整数の乗算と高速フーリエ変換多倍長整数の乗算と高速フーリエ変換
多倍長整数の乗算と高速フーリエ変換京大 マイコンクラブ
 
関数型プログラミング入門 with OCaml
関数型プログラミング入門 with OCaml関数型プログラミング入門 with OCaml
関数型プログラミング入門 with OCamlHaruka Oikawa
 
純粋関数型アルゴリズム入門
純粋関数型アルゴリズム入門純粋関数型アルゴリズム入門
純粋関数型アルゴリズム入門Kimikazu Kato
 
これから Haskell を書くにあたって
これから Haskell を書くにあたってこれから Haskell を書くにあたって
これから Haskell を書くにあたってTsuyoshi Matsudate
 
C++の話(本当にあった怖い話)
C++の話(本当にあった怖い話)C++の話(本当にあった怖い話)
C++の話(本当にあった怖い話)Yuki Tamura
 
オープンソースで提供される第二のJVM:OpenJ9 VMとIBM Javaについて
オープンソースで提供される第二のJVM:OpenJ9 VMとIBM Javaについてオープンソースで提供される第二のJVM:OpenJ9 VMとIBM Javaについて
オープンソースで提供される第二のJVM:OpenJ9 VMとIBM JavaについてTakakiyo Tanaka
 
第11回ACRiウェビナー_インテル/竹村様ご講演資料
第11回ACRiウェビナー_インテル/竹村様ご講演資料第11回ACRiウェビナー_インテル/竹村様ご講演資料
第11回ACRiウェビナー_インテル/竹村様ご講演資料直久 住川
 
"Simple Made Easy" Made Easy
"Simple Made Easy" Made Easy"Simple Made Easy" Made Easy
"Simple Made Easy" Made EasyKent Ohashi
 
Scala警察のすすめ
Scala警察のすすめScala警察のすすめ
Scala警察のすすめtakezoe
 
Rpn and forth 超入門
Rpn and forth 超入門Rpn and forth 超入門
Rpn and forth 超入門Yoshitaka Seo
 
ゲーム開発者のための C++11/C++14
ゲーム開発者のための C++11/C++14ゲーム開発者のための C++11/C++14
ゲーム開発者のための C++11/C++14Ryo Suzuki
 
C++のSTLのコンテナ型を概観する @ Ohotech 特盛 #10(2014.8.30)
C++のSTLのコンテナ型を概観する @ Ohotech 特盛 #10(2014.8.30)C++のSTLのコンテナ型を概観する @ Ohotech 特盛 #10(2014.8.30)
C++のSTLのコンテナ型を概観する @ Ohotech 特盛 #10(2014.8.30)Hiro H.
 
楕円曲線入門 トーラスと楕円曲線のつながり
楕円曲線入門トーラスと楕円曲線のつながり楕円曲線入門トーラスと楕円曲線のつながり
楕円曲線入門 トーラスと楕円曲線のつながりMITSUNARI Shigeo
 
Unityによるリアルタイム通信とMagicOnionによるC#大統一理論の実現
Unityによるリアルタイム通信とMagicOnionによるC#大統一理論の実現Unityによるリアルタイム通信とMagicOnionによるC#大統一理論の実現
Unityによるリアルタイム通信とMagicOnionによるC#大統一理論の実現Yoshifumi Kawai
 

What's hot (20)

LLVM最適化のこつ
LLVM最適化のこつLLVM最適化のこつ
LLVM最適化のこつ
 
暗号技術入門
暗号技術入門暗号技術入門
暗号技術入門
 
Elixirと他言語の比較的紹介 ver.2
Elixirと他言語の比較的紹介ver.2Elixirと他言語の比較的紹介ver.2
Elixirと他言語の比較的紹介 ver.2
 
Nervesが開拓する「ElixirでIoT」の新世界
Nervesが開拓する「ElixirでIoT」の新世界Nervesが開拓する「ElixirでIoT」の新世界
Nervesが開拓する「ElixirでIoT」の新世界
 
PHP の GC の話
PHP の GC の話PHP の GC の話
PHP の GC の話
 
何となく勉強した気分になれるパーサ入門
何となく勉強した気分になれるパーサ入門何となく勉強した気分になれるパーサ入門
何となく勉強した気分になれるパーサ入門
 
多倍長整数の乗算と高速フーリエ変換
多倍長整数の乗算と高速フーリエ変換多倍長整数の乗算と高速フーリエ変換
多倍長整数の乗算と高速フーリエ変換
 
関数型プログラミング入門 with OCaml
関数型プログラミング入門 with OCaml関数型プログラミング入門 with OCaml
関数型プログラミング入門 with OCaml
 
純粋関数型アルゴリズム入門
純粋関数型アルゴリズム入門純粋関数型アルゴリズム入門
純粋関数型アルゴリズム入門
 
これから Haskell を書くにあたって
これから Haskell を書くにあたってこれから Haskell を書くにあたって
これから Haskell を書くにあたって
 
C++の話(本当にあった怖い話)
C++の話(本当にあった怖い話)C++の話(本当にあった怖い話)
C++の話(本当にあった怖い話)
 
オープンソースで提供される第二のJVM:OpenJ9 VMとIBM Javaについて
オープンソースで提供される第二のJVM:OpenJ9 VMとIBM Javaについてオープンソースで提供される第二のJVM:OpenJ9 VMとIBM Javaについて
オープンソースで提供される第二のJVM:OpenJ9 VMとIBM Javaについて
 
第11回ACRiウェビナー_インテル/竹村様ご講演資料
第11回ACRiウェビナー_インテル/竹村様ご講演資料第11回ACRiウェビナー_インテル/竹村様ご講演資料
第11回ACRiウェビナー_インテル/竹村様ご講演資料
 
"Simple Made Easy" Made Easy
"Simple Made Easy" Made Easy"Simple Made Easy" Made Easy
"Simple Made Easy" Made Easy
 
Scala警察のすすめ
Scala警察のすすめScala警察のすすめ
Scala警察のすすめ
 
Rpn and forth 超入門
Rpn and forth 超入門Rpn and forth 超入門
Rpn and forth 超入門
 
ゲーム開発者のための C++11/C++14
ゲーム開発者のための C++11/C++14ゲーム開発者のための C++11/C++14
ゲーム開発者のための C++11/C++14
 
C++のSTLのコンテナ型を概観する @ Ohotech 特盛 #10(2014.8.30)
C++のSTLのコンテナ型を概観する @ Ohotech 特盛 #10(2014.8.30)C++のSTLのコンテナ型を概観する @ Ohotech 特盛 #10(2014.8.30)
C++のSTLのコンテナ型を概観する @ Ohotech 特盛 #10(2014.8.30)
 
楕円曲線入門 トーラスと楕円曲線のつながり
楕円曲線入門トーラスと楕円曲線のつながり楕円曲線入門トーラスと楕円曲線のつながり
楕円曲線入門 トーラスと楕円曲線のつながり
 
Unityによるリアルタイム通信とMagicOnionによるC#大統一理論の実現
Unityによるリアルタイム通信とMagicOnionによるC#大統一理論の実現Unityによるリアルタイム通信とMagicOnionによるC#大統一理論の実現
Unityによるリアルタイム通信とMagicOnionによるC#大統一理論の実現
 

Viewers also liked

解説?FSharp.Quotations.Compiler
解説?FSharp.Quotations.Compiler解説?FSharp.Quotations.Compiler
解説?FSharp.Quotations.Compilerbleis tift
 
モナドハンズオン前座
モナドハンズオン前座モナドハンズオン前座
モナドハンズオン前座bleis tift
 
F#の基礎(?)
F#の基礎(?)F#の基礎(?)
F#の基礎(?)bleis tift
 
Better C#の脱却を目指して
Better C#の脱却を目指してBetter C#の脱却を目指して
Better C#の脱却を目指してbleis tift
 
Capítol 1 música amagada
Capítol 1 música amagadaCapítol 1 música amagada
Capítol 1 música amagadaJoanprofe
 
「民進党ゆるキャラ総選挙」人気を予測しました
「民進党ゆるキャラ総選挙」人気を予測しました「民進党ゆるキャラ総選挙」人気を予測しました
「民進党ゆるキャラ総選挙」人気を予測しましたToshihisa Tanaka
 
Microservices. The good, the bad and the ugly.
Microservices. The good, the bad and the ugly.Microservices. The good, the bad and the ugly.
Microservices. The good, the bad and the ugly.Sander Hoogendoorn
 
Update version of the SMBE/SESBE Lecture on ENCODE & junk DNA (Graur, Decembe...
Update version of the SMBE/SESBE Lecture on ENCODE & junk DNA (Graur, Decembe...Update version of the SMBE/SESBE Lecture on ENCODE & junk DNA (Graur, Decembe...
Update version of the SMBE/SESBE Lecture on ENCODE & junk DNA (Graur, Decembe...Dan Graur
 
Introduction to customer success by Guy Nirpaz @ Totango
Introduction to customer success  by Guy Nirpaz @ TotangoIntroduction to customer success  by Guy Nirpaz @ Totango
Introduction to customer success by Guy Nirpaz @ TotangoCEO Quest
 
インクルーシブ教育システムの構築に向けたスクールワイドな支援モデルの可能性
インクルーシブ教育システムの構築に向けたスクールワイドな支援モデルの可能性インクルーシブ教育システムの構築に向けたスクールワイドな支援モデルの可能性
インクルーシブ教育システムの構築に向けたスクールワイドな支援モデルの可能性Akina Noguchi
 
Fc - 5 fortes motivos meninas aprenderem a programar já
Fc - 5 fortes motivos meninas aprenderem a programar jáFc - 5 fortes motivos meninas aprenderem a programar já
Fc - 5 fortes motivos meninas aprenderem a programar jáJayme Nigri
 
ปรัชญากับวิถีชีวิต
ปรัชญากับวิถีชีวิตปรัชญากับวิถีชีวิต
ปรัชญากับวิถีชีวิตPadvee Academy
 
How *NOT* to firmware
How *NOT* to firmwareHow *NOT* to firmware
How *NOT* to firmwareAmit Serper
 
1ST YEAR Infographics about team sport
 1ST YEAR Infographics about team sport 1ST YEAR Infographics about team sport
1ST YEAR Infographics about team sportCiclos Formativos
 
Making Story Apps - The Art of Little Red Riding Hood
Making Story Apps - The Art of Little Red Riding HoodMaking Story Apps - The Art of Little Red Riding Hood
Making Story Apps - The Art of Little Red Riding Hoodedatnosycrow
 
Tell your own story : how can you build human values for innovation? (preview)
Tell your own story : how can you build human values for innovation? (preview)Tell your own story : how can you build human values for innovation? (preview)
Tell your own story : how can you build human values for innovation? (preview)WeAreInnovation
 

Viewers also liked (20)

解説?FSharp.Quotations.Compiler
解説?FSharp.Quotations.Compiler解説?FSharp.Quotations.Compiler
解説?FSharp.Quotations.Compiler
 
モナドハンズオン前座
モナドハンズオン前座モナドハンズオン前座
モナドハンズオン前座
 
F#の基礎(?)
F#の基礎(?)F#の基礎(?)
F#の基礎(?)
 
Better C#の脱却を目指して
Better C#の脱却を目指してBetter C#の脱却を目指して
Better C#の脱却を目指して
 
Capítol 1 música amagada
Capítol 1 música amagadaCapítol 1 música amagada
Capítol 1 música amagada
 
「民進党ゆるキャラ総選挙」人気を予測しました
「民進党ゆるキャラ総選挙」人気を予測しました「民進党ゆるキャラ総選挙」人気を予測しました
「民進党ゆるキャラ総選挙」人気を予測しました
 
Microservices. The good, the bad and the ugly.
Microservices. The good, the bad and the ugly.Microservices. The good, the bad and the ugly.
Microservices. The good, the bad and the ugly.
 
Sadigh Gallery Spring Savings Events 2017
Sadigh Gallery Spring Savings Events 2017Sadigh Gallery Spring Savings Events 2017
Sadigh Gallery Spring Savings Events 2017
 
Update version of the SMBE/SESBE Lecture on ENCODE & junk DNA (Graur, Decembe...
Update version of the SMBE/SESBE Lecture on ENCODE & junk DNA (Graur, Decembe...Update version of the SMBE/SESBE Lecture on ENCODE & junk DNA (Graur, Decembe...
Update version of the SMBE/SESBE Lecture on ENCODE & junk DNA (Graur, Decembe...
 
Presentacion estrella rural
Presentacion estrella ruralPresentacion estrella rural
Presentacion estrella rural
 
Introduction to customer success by Guy Nirpaz @ Totango
Introduction to customer success  by Guy Nirpaz @ TotangoIntroduction to customer success  by Guy Nirpaz @ Totango
Introduction to customer success by Guy Nirpaz @ Totango
 
インクルーシブ教育システムの構築に向けたスクールワイドな支援モデルの可能性
インクルーシブ教育システムの構築に向けたスクールワイドな支援モデルの可能性インクルーシブ教育システムの構築に向けたスクールワイドな支援モデルの可能性
インクルーシブ教育システムの構築に向けたスクールワイドな支援モデルの可能性
 
White paper on french companies in india
White paper on french companies in indiaWhite paper on french companies in india
White paper on french companies in india
 
Fc - 5 fortes motivos meninas aprenderem a programar já
Fc - 5 fortes motivos meninas aprenderem a programar jáFc - 5 fortes motivos meninas aprenderem a programar já
Fc - 5 fortes motivos meninas aprenderem a programar já
 
Pieredze daudzdzīvokļu dzīvojamo māju siltināšanā
Pieredze daudzdzīvokļu dzīvojamo māju siltināšanāPieredze daudzdzīvokļu dzīvojamo māju siltināšanā
Pieredze daudzdzīvokļu dzīvojamo māju siltināšanā
 
ปรัชญากับวิถีชีวิต
ปรัชญากับวิถีชีวิตปรัชญากับวิถีชีวิต
ปรัชญากับวิถีชีวิต
 
How *NOT* to firmware
How *NOT* to firmwareHow *NOT* to firmware
How *NOT* to firmware
 
1ST YEAR Infographics about team sport
 1ST YEAR Infographics about team sport 1ST YEAR Infographics about team sport
1ST YEAR Infographics about team sport
 
Making Story Apps - The Art of Little Red Riding Hood
Making Story Apps - The Art of Little Red Riding HoodMaking Story Apps - The Art of Little Red Riding Hood
Making Story Apps - The Art of Little Red Riding Hood
 
Tell your own story : how can you build human values for innovation? (preview)
Tell your own story : how can you build human values for innovation? (preview)Tell your own story : how can you build human values for innovation? (preview)
Tell your own story : how can you build human values for innovation? (preview)
 

Similar to 仕事で使うF#

GE8151 Problem Solving and Python Programming
GE8151 Problem Solving and Python ProgrammingGE8151 Problem Solving and Python Programming
GE8151 Problem Solving and Python ProgrammingMuthu Vinayagam
 
lab03build.bat@echo offclsset DRIVE_LETTER=1set.docx
lab03build.bat@echo offclsset DRIVE_LETTER=1set.docxlab03build.bat@echo offclsset DRIVE_LETTER=1set.docx
lab03build.bat@echo offclsset DRIVE_LETTER=1set.docxDIPESH30
 
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docxlab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docxDIPESH30
 
Functional Programming in F#
Functional Programming in F#Functional Programming in F#
Functional Programming in F#Dmitri Nesteruk
 
Functions In Scala
Functions In Scala Functions In Scala
Functions In Scala Knoldus Inc.
 
Lex (lexical analyzer)
Lex (lexical analyzer)Lex (lexical analyzer)
Lex (lexical analyzer)Sami Said
 
Scala - where objects and functions meet
Scala - where objects and functions meetScala - where objects and functions meet
Scala - where objects and functions meetMario Fusco
 
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
[FT-11][suhorng] “Poor Man's” Undergraduate CompilersFunctional Thursday
 
The Kotlin Programming Language
The Kotlin Programming LanguageThe Kotlin Programming Language
The Kotlin Programming Languageintelliyole
 
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPythonByterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPythonakaptur
 
C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)Saifur Rahman
 
Mouse programming in c
Mouse programming in cMouse programming in c
Mouse programming in cgkgaur1987
 
Implementing Software Machines in Go and C
Implementing Software Machines in Go and CImplementing Software Machines in Go and C
Implementing Software Machines in Go and CEleanor McHugh
 
JBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java ProgrammersJBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java ProgrammersTikal Knowledge
 
sonam Kumari python.ppt
sonam Kumari python.pptsonam Kumari python.ppt
sonam Kumari python.pptssuserd64918
 
An overview of Python 2.7
An overview of Python 2.7An overview of Python 2.7
An overview of Python 2.7decoupled
 

Similar to 仕事で使うF# (20)

GE8151 Problem Solving and Python Programming
GE8151 Problem Solving and Python ProgrammingGE8151 Problem Solving and Python Programming
GE8151 Problem Solving and Python Programming
 
lab03build.bat@echo offclsset DRIVE_LETTER=1set.docx
lab03build.bat@echo offclsset DRIVE_LETTER=1set.docxlab03build.bat@echo offclsset DRIVE_LETTER=1set.docx
lab03build.bat@echo offclsset DRIVE_LETTER=1set.docx
 
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docxlab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
 
Scala 2 + 2 > 4
Scala 2 + 2 > 4Scala 2 + 2 > 4
Scala 2 + 2 > 4
 
Functional Programming in F#
Functional Programming in F#Functional Programming in F#
Functional Programming in F#
 
Functions In Scala
Functions In Scala Functions In Scala
Functions In Scala
 
Lex (lexical analyzer)
Lex (lexical analyzer)Lex (lexical analyzer)
Lex (lexical analyzer)
 
String Manipulation Function and Header File Functions
String Manipulation Function and Header File FunctionsString Manipulation Function and Header File Functions
String Manipulation Function and Header File Functions
 
Scala - where objects and functions meet
Scala - where objects and functions meetScala - where objects and functions meet
Scala - where objects and functions meet
 
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
 
The Kotlin Programming Language
The Kotlin Programming LanguageThe Kotlin Programming Language
The Kotlin Programming Language
 
F# intro
F# introF# intro
F# intro
 
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPythonByterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
 
C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)
 
Mouse programming in c
Mouse programming in cMouse programming in c
Mouse programming in c
 
C# programming
C# programming C# programming
C# programming
 
Implementing Software Machines in Go and C
Implementing Software Machines in Go and CImplementing Software Machines in Go and C
Implementing Software Machines in Go and C
 
JBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java ProgrammersJBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java Programmers
 
sonam Kumari python.ppt
sonam Kumari python.pptsonam Kumari python.ppt
sonam Kumari python.ppt
 
An overview of Python 2.7
An overview of Python 2.7An overview of Python 2.7
An overview of Python 2.7
 

More from bleis tift

PCさえあればいい。
PCさえあればいい。PCさえあればいい。
PCさえあればいい。bleis tift
 
No more Legacy documents
No more Legacy documentsNo more Legacy documents
No more Legacy documentsbleis tift
 
効果の低いテストの話
効果の低いテストの話効果の低いテストの話
効果の低いテストの話bleis tift
 
テストの自動化を考える前に
テストの自動化を考える前にテストの自動化を考える前に
テストの自動化を考える前にbleis tift
 
札束でExcelを殴る
札束でExcelを殴る札束でExcelを殴る
札束でExcelを殴るbleis tift
 
.NET系開発者から見たJava
.NET系開発者から見たJava.NET系開発者から見たJava
.NET系開発者から見たJavableis tift
 
SI屋のためのF# ~DSL編~
SI屋のためのF# ~DSL編~SI屋のためのF# ~DSL編~
SI屋のためのF# ~DSL編~bleis tift
 
F#事例発表
F#事例発表F#事例発表
F#事例発表bleis tift
 
yield and return (poor English ver)
yield and return (poor English ver)yield and return (poor English ver)
yield and return (poor English ver)bleis tift
 
yieldとreturnの話
yieldとreturnの話yieldとreturnの話
yieldとreturnの話bleis tift
 
F#の基礎(嘘)
F#の基礎(嘘)F#の基礎(嘘)
F#の基礎(嘘)bleis tift
 
現実(えくせる)と戦う話
現実(えくせる)と戦う話現実(えくせる)と戦う話
現実(えくせる)と戦う話bleis tift
 
ラムダでウィザード 滅せよ手続き、とチャーチは言った (※言ってません)
ラムダでウィザード 滅せよ手続き、とチャーチは言った (※言ってません)ラムダでウィザード 滅せよ手続き、とチャーチは言った (※言ってません)
ラムダでウィザード 滅せよ手続き、とチャーチは言った (※言ってません)bleis tift
 
async/await不要論
async/await不要論async/await不要論
async/await不要論bleis tift
 
F#によるFunctional Programming入門
F#によるFunctional Programming入門F#によるFunctional Programming入門
F#によるFunctional Programming入門bleis tift
 
VBAを書きたくない話(Excel-DNAの紹介)
VBAを書きたくない話(Excel-DNAの紹介)VBAを書きたくない話(Excel-DNAの紹介)
VBAを書きたくない話(Excel-DNAの紹介)bleis tift
 
JSX / Haxe / TypeScript
JSX / Haxe / TypeScriptJSX / Haxe / TypeScript
JSX / Haxe / TypeScriptbleis tift
 
F#で始めるスマートフォンアプリ
F#で始めるスマートフォンアプリF#で始めるスマートフォンアプリ
F#で始めるスマートフォンアプリbleis tift
 
ぼくのかんがえたさいきょうのLL
ぼくのかんがえたさいきょうのLLぼくのかんがえたさいきょうのLL
ぼくのかんがえたさいきょうのLLbleis tift
 

More from bleis tift (20)

PCさえあればいい。
PCさえあればいい。PCさえあればいい。
PCさえあればいい。
 
No more Legacy documents
No more Legacy documentsNo more Legacy documents
No more Legacy documents
 
効果の低いテストの話
効果の低いテストの話効果の低いテストの話
効果の低いテストの話
 
テストの自動化を考える前に
テストの自動化を考える前にテストの自動化を考える前に
テストの自動化を考える前に
 
札束でExcelを殴る
札束でExcelを殴る札束でExcelを殴る
札束でExcelを殴る
 
.NET系開発者から見たJava
.NET系開発者から見たJava.NET系開発者から見たJava
.NET系開発者から見たJava
 
SI屋のためのF# ~DSL編~
SI屋のためのF# ~DSL編~SI屋のためのF# ~DSL編~
SI屋のためのF# ~DSL編~
 
F#事例発表
F#事例発表F#事例発表
F#事例発表
 
yield and return (poor English ver)
yield and return (poor English ver)yield and return (poor English ver)
yield and return (poor English ver)
 
yieldとreturnの話
yieldとreturnの話yieldとreturnの話
yieldとreturnの話
 
F#の基礎(嘘)
F#の基礎(嘘)F#の基礎(嘘)
F#の基礎(嘘)
 
現実(えくせる)と戦う話
現実(えくせる)と戦う話現実(えくせる)と戦う話
現実(えくせる)と戦う話
 
ラムダでウィザード 滅せよ手続き、とチャーチは言った (※言ってません)
ラムダでウィザード 滅せよ手続き、とチャーチは言った (※言ってません)ラムダでウィザード 滅せよ手続き、とチャーチは言った (※言ってません)
ラムダでウィザード 滅せよ手続き、とチャーチは言った (※言ってません)
 
async/await不要論
async/await不要論async/await不要論
async/await不要論
 
F#によるFunctional Programming入門
F#によるFunctional Programming入門F#によるFunctional Programming入門
F#によるFunctional Programming入門
 
VBAを書きたくない話(Excel-DNAの紹介)
VBAを書きたくない話(Excel-DNAの紹介)VBAを書きたくない話(Excel-DNAの紹介)
VBAを書きたくない話(Excel-DNAの紹介)
 
JSX / Haxe / TypeScript
JSX / Haxe / TypeScriptJSX / Haxe / TypeScript
JSX / Haxe / TypeScript
 
自分戦略
自分戦略自分戦略
自分戦略
 
F#で始めるスマートフォンアプリ
F#で始めるスマートフォンアプリF#で始めるスマートフォンアプリ
F#で始めるスマートフォンアプリ
 
ぼくのかんがえたさいきょうのLL
ぼくのかんがえたさいきょうのLLぼくのかんがえたさいきょうのLL
ぼくのかんがえたさいきょうのLL
 

Recently uploaded

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 

Recently uploaded (20)

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 

仕事で使うF#

  • 1. F# bleis-tift August 28, 2011
  • 2.
  • 3. F# F# NParsec FParsec
  • 4. F#
  • 6. F#
  • 8. 1 3 [1; 2; 3] [1..3] 1::2::3::[] 1::2::[3] [ 1 2 3 ]
  • 10. cons
  • 11. cons
  • 12. cons
  • 13. cons
  • 14. cons
  • 15. let xs = [2..10] let ys = 1::xs
  • 16. int string int * string
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22. 1 let x, y = 10, 20 printfn "%A" (x, y) // => (10, 20) 2 let (x, y) as tpl = 1, 2 printfn "%A" tpl // => (1, 2) printfn "%A" (x, y) // => (1, 2) printfn "(%d, %d)" x y // => (1, 2)
  • 23. let [x; y] as lst = [1; 2] printfn "%A" lst // => [1; 2] printfn "%A" [x; y] // => [1; 2] printfn "[%d; %d]" x y // => [1; 2] warning FS0025: ’[_;_;_]’
  • 24. 1
  • 25. 1
  • 26. 1
  • 27. 2 (2, "hoge") // int * string // [2; "hoge"] [box 1; box "hoge"] // obj list
  • 28. 2
  • 29.
  • 30.
  • 31. // , let p = " ", 21 type Person = { Name: string Age: int } let p = { Name = " "; Age = 21 } 4
  • 32. F# type Person(name: string, age: int) = member this.Name = name member this.Age = age let p = Person(" ", 21) type Person = { Name: string; Age: int } let p = { Name = " "; Age = 21 }
  • 33. type Person(name: string, age: int) = member x.Name = name member x.Age = age let f p = p.Name error FS0072:
  • 34. type Person = { Name: string; Age: int } let f p = p.Name type Person = {Name: string; Age: int;} val f : Person -> string
  • 35. ( )
  • 38. C# public abstract class HtmlElem {} public class Heading : HtmlElem { public int Level { get; private set; } public string Text { get; private set; } public Heading(int level, string txt) { Level = level; Text = txt; } } public class Text : HtmlElem { public string Text { get; private set; } public Text(string txt) { Text = txt; } } public class HorizontalLine : HtmlElem {}
  • 39. F# type HtmlElem = | Text of string | Heading of int * string | HorizontalLine
  • 42. F# F# C#
  • 43.
  • 44. HtmlElem HTML type HtmlElem = | Heading of int * string | Text of string | HorizontalLine let toHtmlStr elem = let h lv s = sprintf "<h%d>%s</h%d>" lv s lv match elem with | Heading(level, txt) -> h level txt | Text txt -> "<p>" + txt + "</p>" | HorizontalLine -> "<hr/>" match
  • 45. let add = function | 0, y -> y | x, 0 -> x | x, y -> x + y function
  • 46. match function match let add tpl = match tpl with | x, y -> x + y function let add = function | x, y -> x + y
  • 47. type t = { Tag: int; Value: int } let value { Value = v } = v
  • 48. match match let add tpl = match tpl with | x, y -> x + y function let add = function | x, y -> x + y let add (x, y) = x + y
  • 49. Person type Name = { FirstName: string LastName: string } type Person = { Name: Name; Age: int } let f x = let { Name = { FirstName = fn } } = x fn
  • 50. F#
  • 51. Maybe type MaybeBuilder() = member this.Bind(x, f) = x |> Option.bind f member this.Return(x) = Some x let maybe = MaybeBuilder() let plus db = maybe { let! x = db |> Map.tryFind "x" let! y = db |> Map.tryFind "y" return x + y }
  • 52.
  • 53. Map-Reduce ( ) fold reduce fold
  • 54. fold reduce fold reduce
  • 55. F# fold reduce > List.fold;; val it : ((’a -> ’b -> ’a) -> ’a -> ’b list -> ’a) = <fun:clo@1> > List.reduce;; val it : ((’a -> ’a -> ’a) -> ’a list -> ’a) = <fun:clo@2-1> fold reduce list list
  • 56. fold
  • 57. fold
  • 58. fold
  • 59. fold
  • 62. fold sum sum let sum xs = List.fold (+) 0 xs
  • 63. fold forall forall let forall p xs = xs |> List.fold (fun acc x -> acc && (p x)) true exists
  • 64. fold map map let map f xs = ([], xs) ||> List.fold (fun acc x -> acc @ [f x] )
  • 65. fold filter filter let filter p xs = ([], xs) ||> List.fold begin acc x -> if p x then acc @ [x] else acc end
  • 66. fold fold fold( unfold) fold
  • 67. F#
  • 68. F# F# .NET
  • 69. F# F# .NET Framework
  • 70. .NET Framework 2.0 .NET Framework F#
  • 71. .NET Framework F# .NET Framework2.0 Runtime .NET Framework2.0 LINQ F # List .NET Framework 2.0 F#
  • 72. .NET Framework 4.0 F# TDDBC Tokyo 1.6 C# ( ) KeyValueTime.cs 42 SystemClock.cs 30 TddbcKeyValueStore.cs 67 F# ( ) KeyValueStore.fs 48 C# 139 F# 48
  • 73. .NET Framework 4.0 F# TDDBC Tokyo 1.6 C# ( ) KeyValueTimeTest.cs 141 SystemClockTest.cs 34 TddbcKeyValueStoreTest.cs 346 ( ) F# ( ) KeyValueStore.fs 170 C# 521 F# 170
  • 75. F# .NET F# option
  • 76. F# C# VB
  • 77. .NET C# VB
  • 78. F# list F# dll array seq
  • 79. static NewHoge Tag IsHoge F#
  • 80. module Hoge let plus10 = ((+)10) Hoge.plus10 FSharp.Core.FSharpFunc FSharp.Core.dll
  • 81. NParsec FParsec
  • 82.
  • 83. yacc lex yacc lex
  • 84. BNF
  • 86. NParsec parsec .NET C# C# Java Scanner
  • 87. FParsec parsec .NET F#
  • 88. NParsec FParsec
  • 89. NParsec var lazyexpr = new Parser<double>[1]; var plazyexpr = Parsers.Lazy<double>(() => lazyexpr[0] ); var pterm = plazyexpr.Between(popen, pclose) | pnum; var pexpr = ... lazyexpr[0] = pexpr;
  • 90. FParsec let pexpr, exprref = createParserForwardedToRef() let pterm = pexpr |> between popen pclose <|> pnum do exprref := ...
  • 91. F# 10 C# 54 C# Visitor
  • 92. C# F#
  • 93. NParsec Bind return Parsers.Return(...) FParsec
  • 95.
  • 96.
  • 97.
  • 98. F# FParsec F#