際際滷

際際滷Share a Scribd company logo
Design Pattern In Functional Language覦-蠖:豢螳覦-
覈谿1.  語2.F#3. Design Pattern
 語LISPCommon Lisp, Scheme, ClojureMLSML, nML, Ocaml, F#Etc.Haskell, Erlang
 語企 (lambda calculus)f(x) = x+10(了x.x+10)(了x.x+10) 32 = 32 + 10 = 42(了op.了x.(op x x)) (+) 21 = (了x.((+) x x)) 21 = (+) 21 21 = 42覿 螻(side-effect) ろ 碁 殊 .  語企 覿螻手  .
 語伎蠏 (Recursion)覿覲螳(Immutable Value)螻谿  (High-Order Function)襯 る  豢襦 (Type Inference)ML襯 語
F#HistoryF# 1.0.12005, SDK For VS2003OCaml .NET朱F# 2.02010, VS2010 First Class Language.NET Language
F# BasicF# InteractiveInterpreterInteractive DevelopmentF# TutorialVS2010  Tutorial Project <demo>
F# Syntaxlet 螳 let x = 42let z : string = nulllet F x y = x + ylet F (x,y) = x + y
F# Syntaxfun覓企() let nums = [1; 2; 3;]let odds =List.filter (fun x -> x%2 = 1) numslet oddsSquare =    List.map (fun x -> x * x)        (List.filter (fun x-> x%2 = 1 ) nums)
F# Syntax|>危 一一.let odds =nums    |> List.filter (fun x -> x%2 = 1)let oddsSquare =nums    |> List.filter (fun x -> x%2 = 1)    |> List.map (fun x -> x*x)覲蟇 蟇 螳讌襷 麹 螳煙 譴.
F# SyntaxDiscriminated Uniontype Shape =    | Rect of Point * Point    | Ellipse of Point * Point    | Comp of Shape * Shape
F# SyntaxPattern Matchlet AreaOf shape =    match shape with    | Rect(pf, pt) -> rectArea(pf,pt)    | Ellipse(pf,pt) -> ellipseArea(pf,pt)    | Comp(Rect(p1,p2), Rect(p3,p4))        when isNested(p3,p4,p1,p2)        -> rectArea(p1,p2)    | Comp(s1,s2) ->        let area1 = shapeArea(s1)        let area2 = shapeArea(s2)        area1 + area2  (intersectArea(s1,s2))
Design PatternStrategy PatternCommand PatternComposite PatternDecorate Pattern
Strategy Pattern
Composite Pattern
Command Pattern
Decorate Pattern
谿瑚襭http://www.functional-programming.net/Head First Design Patternshttp://oreilly.com/catalog/9780596007126

More Related Content

What's hot (9)

螻襴讀 壱貂 碁碁 1-C (螻襴讀 り 覈碁 覦 )
螻襴讀 壱貂 碁碁 1-C (螻襴讀 り 覈碁 覦 )螻襴讀 壱貂 碁碁 1-C (螻襴讀 り 覈碁 覦 )
螻襴讀 壱貂 碁碁 1-C (螻襴讀 り 覈碁 覦 )
HYUNJEONG KIM
襷襷
mil23
[C++ korea] effective modern c++ study item 2 understanding auto type deduc...
[C++ korea] effective modern c++ study   item 2 understanding auto type deduc...[C++ korea] effective modern c++ study   item 2 understanding auto type deduc...
[C++ korea] effective modern c++ study item 2 understanding auto type deduc...
Seok-joon Yun
Project#2襷 Hwp
Project#2襷 HwpProject#2襷 Hwp
Project#2襷 Hwp
Kimjeongmoo
覿伎る 覲 覦, From c++98 to c++11, 14
覿伎る 覲 覦, From c++98 to c++11, 14 覿伎る 覲 覦, From c++98 to c++11, 14
覿伎る 覲 覦, From c++98 to c++11, 14
覈 蟾
[SICP] 4.4 Logic Programming : 朱Μ襦 襦蠏碁 讌蠍
[SICP] 4.4 Logic Programming : 朱Μ襦 襦蠏碁 讌蠍[SICP] 4.4 Logic Programming : 朱Μ襦 襦蠏碁 讌蠍
[SICP] 4.4 Logic Programming : 朱Μ襦 襦蠏碁 讌蠍
譬觜
2.1 覿 觜覯
2.1 覿 觜覯2.1 覿 觜覯
2.1 覿 觜覯
譴 蟾
HI-ARC PS 101
HI-ARC PS 101HI-ARC PS 101
HI-ARC PS 101
Jae-yeol Lee
螻襴讀 壱貂 碁碁 1-C (螻襴讀 り 覈碁 覦 )
螻襴讀 壱貂 碁碁 1-C (螻襴讀 り 覈碁 覦 )螻襴讀 壱貂 碁碁 1-C (螻襴讀 り 覈碁 覦 )
螻襴讀 壱貂 碁碁 1-C (螻襴讀 り 覈碁 覦 )
HYUNJEONG KIM
襷襷
mil23
[C++ korea] effective modern c++ study item 2 understanding auto type deduc...
[C++ korea] effective modern c++ study   item 2 understanding auto type deduc...[C++ korea] effective modern c++ study   item 2 understanding auto type deduc...
[C++ korea] effective modern c++ study item 2 understanding auto type deduc...
Seok-joon Yun
Project#2襷 Hwp
Project#2襷 HwpProject#2襷 Hwp
Project#2襷 Hwp
Kimjeongmoo
覿伎る 覲 覦, From c++98 to c++11, 14
覿伎る 覲 覦, From c++98 to c++11, 14 覿伎る 覲 覦, From c++98 to c++11, 14
覿伎る 覲 覦, From c++98 to c++11, 14
覈 蟾
[SICP] 4.4 Logic Programming : 朱Μ襦 襦蠏碁 讌蠍
[SICP] 4.4 Logic Programming : 朱Μ襦 襦蠏碁 讌蠍[SICP] 4.4 Logic Programming : 朱Μ襦 襦蠏碁 讌蠍
[SICP] 4.4 Logic Programming : 朱Μ襦 襦蠏碁 讌蠍
譬觜
2.1 覿 觜覯
2.1 覿 觜覯2.1 覿 觜覯
2.1 覿 觜覯
譴 蟾

Viewers also liked (9)

Introduction to prolog
Introduction to prologIntroduction to prolog
Introduction to prolog
SH Park
xunittestpatternchapter15
xunittestpatternchapter15xunittestpatternchapter15
xunittestpatternchapter15
SH Park
5. 蠏碁 碁Μ (3,4)
5. 蠏碁 碁Μ (3,4)5. 蠏碁 碁Μ (3,4)
5. 蠏碁 碁Μ (3,4)
SH Park
PrimesIsInP
PrimesIsInPPrimesIsInP
PrimesIsInP
SH Park
4 ろ豸 覡伎 - 豢蟲
4 ろ豸 覡伎 -  豢蟲4 ろ豸 覡伎 -  豢蟲
4 ろ豸 覡伎 - 豢蟲
SH Park
覃 譯朱 り - 16 蠏覈 蟲譟
覃 譯朱 り - 16 蠏覈 蟲譟覃 譯朱 り - 16 蠏覈 蟲譟
覃 譯朱 り - 16 蠏覈 蟲譟
SH Park
Apprenticeship patterns chapter4
Apprenticeship patterns chapter4Apprenticeship patterns chapter4
Apprenticeship patterns chapter4
SH Park
襦蠏碁襾語 蠍,覃蟆 覓視 2
襦蠏碁襾語 蠍,覃蟆 覓視 2襦蠏碁襾語 蠍,覃蟆 覓視 2
襦蠏碁襾語 蠍,覃蟆 覓視 2
hyun soomyung
Nodejs_chapter9
Nodejs_chapter9Nodejs_chapter9
Nodejs_chapter9
SH Park
Introduction to prolog
Introduction to prologIntroduction to prolog
Introduction to prolog
SH Park
xunittestpatternchapter15
xunittestpatternchapter15xunittestpatternchapter15
xunittestpatternchapter15
SH Park
5. 蠏碁 碁Μ (3,4)
5. 蠏碁 碁Μ (3,4)5. 蠏碁 碁Μ (3,4)
5. 蠏碁 碁Μ (3,4)
SH Park
PrimesIsInP
PrimesIsInPPrimesIsInP
PrimesIsInP
SH Park
4 ろ豸 覡伎 - 豢蟲
4 ろ豸 覡伎 -  豢蟲4 ろ豸 覡伎 -  豢蟲
4 ろ豸 覡伎 - 豢蟲
SH Park
覃 譯朱 り - 16 蠏覈 蟲譟
覃 譯朱 り - 16 蠏覈 蟲譟覃 譯朱 り - 16 蠏覈 蟲譟
覃 譯朱 り - 16 蠏覈 蟲譟
SH Park
Apprenticeship patterns chapter4
Apprenticeship patterns chapter4Apprenticeship patterns chapter4
Apprenticeship patterns chapter4
SH Park
襦蠏碁襾語 蠍,覃蟆 覓視 2
襦蠏碁襾語 蠍,覃蟆 覓視 2襦蠏碁襾語 蠍,覃蟆 覓視 2
襦蠏碁襾語 蠍,覃蟆 覓視 2
hyun soomyung
Nodejs_chapter9
Nodejs_chapter9Nodejs_chapter9
Nodejs_chapter9
SH Park

Similar to Design Pattern In Functional Language (15)

Go
GoGo
Go
螻 2
 螻 2 螻 2
螻 2
HyeonSeok Choi
れ梗殊 ろ 殊
れ梗殊 ろ 殊 れ梗殊 ろ 殊
れ梗殊 ろ 殊
Taeoh Kim
Macro & compilation
Macro & compilationMacro & compilation
Macro & compilation
Ikhoon Eom
R 蠍一 : R Basics
R 蠍一 : R BasicsR 蠍一 : R Basics
R 蠍一 : R Basics
Yoonwhan Lee
Valentine
ValentineValentine
Valentine
Cheolung Choi
TABLE ACCESS 伎 伎 SQL _Wh oracle
TABLE ACCESS 伎 伎 SQL _Wh oracleTABLE ACCESS 伎 伎 SQL _Wh oracle
TABLE ACCESS 伎 伎 SQL _Wh oracle
Erlang
ErlangErlang
Erlang
hyun soomyung
Clojure Monad
Clojure MonadClojure Monad
Clojure Monad
Eunmin Kim
螻襴讀螻 襭蟲譟
螻襴讀螻 襭蟲譟螻襴讀螻 襭蟲譟
螻襴讀螻 襭蟲譟
蠍 蟾
Java8
Java8 Java8
Java8
Jong Woo Rhee
R 襦蠏碁覦 蠍磯蓋 覓碁
R 襦蠏碁覦 蠍磯蓋 覓碁R 襦蠏碁覦 蠍磯蓋 覓碁
R 襦蠏碁覦 蠍磯蓋 覓碁
Terry Cho
Pure Function and Honest Design
Pure Function and Honest DesignPure Function and Honest Design
Pure Function and Honest Design
Hyungho Ko
Sicp 2.2 螻豸 蟲譟 一危一 煙
Sicp 2.2 螻豸 蟲譟 一危一  煙Sicp 2.2 螻豸 蟲譟 一危一  煙
Sicp 2.2 螻豸 蟲譟 一危一 煙
aceigy6322
Go
GoGo
Go
れ梗殊 ろ 殊
れ梗殊 ろ 殊 れ梗殊 ろ 殊
れ梗殊 ろ 殊
Taeoh Kim
Macro & compilation
Macro & compilationMacro & compilation
Macro & compilation
Ikhoon Eom
R 蠍一 : R Basics
R 蠍一 : R BasicsR 蠍一 : R Basics
R 蠍一 : R Basics
Yoonwhan Lee
TABLE ACCESS 伎 伎 SQL _Wh oracle
TABLE ACCESS 伎 伎 SQL _Wh oracleTABLE ACCESS 伎 伎 SQL _Wh oracle
TABLE ACCESS 伎 伎 SQL _Wh oracle
Clojure Monad
Clojure MonadClojure Monad
Clojure Monad
Eunmin Kim
螻襴讀螻 襭蟲譟
螻襴讀螻 襭蟲譟螻襴讀螻 襭蟲譟
螻襴讀螻 襭蟲譟
蠍 蟾
R 襦蠏碁覦 蠍磯蓋 覓碁
R 襦蠏碁覦 蠍磯蓋 覓碁R 襦蠏碁覦 蠍磯蓋 覓碁
R 襦蠏碁覦 蠍磯蓋 覓碁
Terry Cho
Pure Function and Honest Design
Pure Function and Honest DesignPure Function and Honest Design
Pure Function and Honest Design
Hyungho Ko
Sicp 2.2 螻豸 蟲譟 一危一 煙
Sicp 2.2 螻豸 蟲譟 一危一  煙Sicp 2.2 螻豸 蟲譟 一危一  煙
Sicp 2.2 螻豸 蟲譟 一危一 煙
aceigy6322

Design Pattern In Functional Language