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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Shig.Takei
November 03, 2012
Programming
190
0
Share
Purely Functional Data Structures chap.10.1
Shig.Takei
November 03, 2012
More Decks by Shig.Takei
See All by Shig.Takei
How Ethereum Works (備忘録)
shtaag
0
51
Other Decks in Programming
See All in Programming
Agentic UI in the Frontend: Architectures with Open Standards @JAX 2026 in Mainz
manfredsteyer
PRO
0
100
Lightning-Fast Method Calls with Ruby 4.1 ZJIT / RubyKaigi 2026
k0kubun
3
2.6k
t *testing.T は どこからやってくるの?
otakakot
1
910
空間オーディオの活用
objectiveaudio
0
140
My daily life on Ruby
a_matsuda
3
190
エラー処理の温故知新 / history of error handling technic
ryotanakaya
7
1.8k
ソースコード→AST→オペコード、の旅を覗いてみる
o0h
PRO
1
130
Oxlintとeslint-plugin-react-hooks 明日から始められそう?
t6adev
0
330
Making the RBS Parser Faster
soutaro
0
670
ハーネスエンジニアリングにどう向き合うか 〜ルールファイルを超えて開発プロセスを設計する〜 / How to approach harness engineering
rkaga
28
19k
Agent Skills を社内で育てる仕組み作り
jackchuka
1
1.5k
2026-04-15 Spring IO - I Can See Clearly Now
jonatan_ivanov
1
190
Featured
See All Featured
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
280
Building a Scalable Design System with Sketch
lauravandoore
463
34k
The Curious Case for Waylosing
cassininazir
0
340
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
260
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.2k
Technical Leadership for Architectural Decision Making
baasie
3
360
Color Theory Basics | Prateek | Gurzu
gurzu
0
310
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
560
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
110
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Building Adaptive Systems
keathley
44
3k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.2k
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༵