Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Purely Functional Data Structures chap.10.1

Shig.Takei
November 03, 2012

Purely Functional Data Structures chap.10.1

Shig.Takei

November 03, 2012
Tweet

More Decks by Shig.Takei

Other Decks in Programming

Transcript

  1. ͱΓ͋͑ͣ͜Μͳͷ ʢStructural Decompositionͷྫʣ data Seq a = NIL | CONS’

    a (Seq (a , a)) ܕaͷSeqͩͬͨ͸͕ͣ ܕ(a,a)ʹมΘͬͯΔʂ 2012೥11݄3೔౔༵೔
  2. 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 2012೥11݄3೔౔༵೔
  3. uniform recursion data List a = NIL | CONS a

    (List a) non-uniform recursion data Seq a = NIL | CONS’ a (Seq (a , a)) 2012೥11݄3೔౔༵೔