Kof2008 Itll

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

No comments yet

Post a comment

    Login or Signup to post a comment
    Edit your comment Cancel

    1 Favorite

    Kof2008 Itll - Presentation Transcript

    1. Introduction to Lazy Lists 2008 UJIHISA, Tatsuhiro
    2. UJIHISA Tatsuhiro • Osaka University • Ruby, Vim, Haskell and Math • http://ujihisa.nowa.jp • http://twitter.com/ujm • To the US!
    3. Targets • • Array, Enumerable, IO (File) Haskell
    4. Lazy lists
    5. • Ruby Haskell (Lazy list) Live coding Vim
    6. Lazy Lists • Lazy lists (or streams) • List (= Array in Ruby) • Only needed parts are calculated. • Haskell supports lazy lists by default. • Ruby can support it.
    7. List (=Array) in Ruby • Array class • [0, 1, 2, 3], Array.new(4) {|i| i } • a #=> [0, 1, 2, 3] a.map {|i| i * 2 } #=> [0, 2, 4, 6]
    8. List • Data structure • Insert, Delete, Access sequentially
    9. c.f. Array • Data structure • Insert, Delete, Access randomly, Size
    10. (List again) • Data structure • Insert, Delete, Access sequentially
    11. Lazy List • Data structure • Insert, Delete, Access sequentially
    12. Types of lazy lists • Boundless length lists ( ) • Undefined length lists ( ) • Defined length lists ( )
    13. How to construct lazy lists?
    14. Notations • array = 1000+ length array heavy = lambda { heavy procedure } • array.take(2).map(&heavy) • array.map(&heavy).take(2)
    15. Common case • truncation (break) • filtering (if, unless; select, reject) • mapping (=, map) • processing (???, each) folding (<<, inject)

    + ujihisaujihisa, 2 years ago

     

    869 views, 1 fav more

    About this presentation

    © All Rights Reserved

    • Favorites 1
    • Downloads 2
    • Total Views 869
      • 869 on SlideShare
    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint

    Categories