1 / 5

CS360 Lab 3

CS360 Lab 3. TA: Mark Boady Professor: Krzysztof Nowak. Homework 3. Flatten (different interpretations) Input: Normal List, Output: Delayed List Input: Delayed List, Output: Normal List Input: Delayed List, Output Delayed List Lambda Calculus

Download Presentation

CS360 Lab 3

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS360 Lab 3 TA: Mark Boady Professor: Krzysztof Nowak

  2. Homework 3 • Flatten (different interpretations) • Input: Normal List, Output: Delayed List • Input: Delayed List, Output: Normal List • Input: Delayed List, Output Delayed List • Lambda Calculus • A detailed walkthrough of question 3.39 is posted to section of the CS360 website • PA1 • A link to an example of the set! command for iterator on my CS360 website

  3. Part 1 • Experiment with pyth.hs and primes.hs in haskell • To take the first 20 primes from the infinite list of primes. Prelude> :load primes [1 of 1] Compiling Main ( primes.hs, interpreted ) Ok, modules loaded: Main. *Main> take 20 primes [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71]

  4. Part 2 • Mceval is a scheme interpreter running inside the scheme interpreter. • A subset of the basic functionality has be redefined • Append is defined here using the basic functionality that works in mceval • Run the code exactly as given • Remember to load the file

  5. Part 3 & 4 • Part 3: Make sure your tree is balanced • Part 4: Haskell has easy Lambda Calc. syntax • In Lambda Calc. the first two Church Numerals • λs.λz. z for zero • λs.λz.(s z) for one • In Haskell • let zero = \s -> \z -> z • let one = \s -> \z -> (s z) • zero (+ 1) 0 • one (+ 1) 0

More Related