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
41
Other Decks in Programming
See All in Programming
『GO』アプリ データ基盤のログ収集システムコスト削減
mot_techtalk
0
120
2024年のkintone API振り返りと2025年 / kintone API look back in 2024
tasshi
0
220
定理証明プラットフォーム lapisla.net
abap34
1
1.8k
AIの力でお手軽Chrome拡張機能作り
taiseiue
0
170
CDK開発におけるコーディング規約の運用
yamanashi_ren01
2
120
Writing documentation can be fun with plugin system
okuramasafumi
0
120
Formの複雑さに立ち向かう
bmthd
1
850
密集、ドキュメントのコロケーション with AWS Lambda
satoshi256kbyte
0
190
GitHub Actions × RAGでコードレビューの検証の結果
sho_000
0
260
苦しいTiDBへの移行を乗り越えて快適な運用を目指す
leveragestech
0
600
時計仕掛けのCompose
mkeeda
1
300
Rubyで始める関数型ドメインモデリング
shogo_tksk
0
110
Featured
See All Featured
Practical Orchestrator
shlominoach
186
10k
What's in a price? How to price your products and services
michaelherold
244
12k
How GitHub (no longer) Works
holman
314
140k
Testing 201, or: Great Expectations
jmmastey
42
7.2k
Rails Girls Zürich Keynote
gr2m
94
13k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Side Projects
sachag
452
42k
Fontdeck: Realign not Redesign
paulrobertlloyd
83
5.4k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
10
1.3k
Fashionably flexible responsive web design (full day workshop)
malarkey
406
66k
Making the Leap to Tech Lead
cromwellryan
133
9.1k
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༵