Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Purely Functional Data Structures chap.10.1
Search
Shig.Takei
November 03, 2012
Programming
0
180
Purely Functional Data Structures chap.10.1
Shig.Takei
November 03, 2012
Tweet
Share
More Decks by Shig.Takei
See All by Shig.Takei
How Ethereum Works (備忘録)
shtaag
0
40
Other Decks in Programming
See All in Programming
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
1.3k
HTML/CSS超絶浅い説明
yuki0329
0
180
為你自己學 Python
eddie
0
510
선언형 UI에서의 상태관리
l2hyunwoo
0
260
Compose UIテストを使った統合テスト
hiroaki404
0
130
rails newと同時に型を書く
aki19035vc
5
690
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
290
Fixstars高速化コンテスト2024準優勝解法
eijirou
0
180
menu基盤チームによるGoogle Cloudの活用事例~Application Integration, Cloud Tasks編~
yoshifumi_ishikura
0
140
見えないメモリを観測する: PHP 8.4 `pg_result_memory_size()` とSQL結果のメモリ管理
kentaroutakeda
0
910
はてなにおけるfujiwara-wareの活用やecspressoのCI/CD構成 / Fujiwara Tech Conference 2025
cohalz
0
130
20年もののレガシープロダクトに 0からPHPStanを入れるまで / phpcon2024
hirobe1999
0
1k
Featured
See All Featured
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.5k
Documentation Writing (for coders)
carmenintech
67
4.5k
Fashionably flexible responsive web design (full day workshop)
malarkey
406
66k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Code Reviewing Like a Champion
maltzj
521
39k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.2k
Building Your Own Lightsaber
phodgson
104
6.2k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
KATA
mclloyd
29
14k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Transcript
Purely Functional Data Structures chap.10.1 Structural Decomposition @shtaag 201211݄3༵
Data-Structural Bootstrappingͷ 201211݄3༵
ͱΓ͋͑ͣ͜Μͳͷ ʢStructural Decompositionͷྫʣ data Seq a = NIL | CONS’
a (Seq (a , a)) 201211݄3༵
ͱΓ͋͑ͣ͜Μͳͷ ʢStructural Decompositionͷྫʣ data Seq a = NIL | CONS’
a (Seq (a , a)) ܕaͷSeq͕ͩͬͨͣ ܕ(a,a)ʹมΘͬͯΔʂ 201211݄3༵
CONS’ a (Seq (a, a)) CONS’ (a, a) (Seq ((a,
a), (a, a)) CONS’ ((a, a), (a, a)) (Seq (((a, a), (a, a)), ((a, a), (a, a))) CONS’ (((a, a), (a, a)), ((a, a), (a, a))) (Seq ((((a, a), (a, a)), ((a, a), (a, a))), (((a, a), (a, a)), ((a, a), (a, a)))) Polymorphic Recursion 201211݄3༵
ҎԼɺ༻ޠ 201211݄3༵
BootStrapping bootstrapping a complete solution from an incomplete solution 201211݄3༵
structural decomposition incompleteͳσʔλߏ͔Β completeͳͷΛbootstrap structural abstraction inefficientͳσʔλߏ͔Β efficientͳߏΛbootstrap 201211݄3༵
uniform recursion data List a = NIL | CONS a
(List a) non-uniform recursion data Seq a = NIL | CONS’ a (Seq (a , a)) 201211݄3༵
Կ͕خ͍͠ʁ ܕͰߏΛറΔ͜ͱͰΞϧΰϦζϜ͕͔Γ͘͢ ͳΔ ઌఔͷseqϊʔυཁૉΛ2ͭ࣋ͭ͜ͱΛอূ ͍ͯ͠Δ sizeS (CONS’ (x, ps)) =
1 + 2 * sizeS ps 201211݄3༵