Download presentation

Presentation is loading. Please wait.

Published byAmani Sandidge Modified over 2 years ago

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,6 1,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

Similar presentations

OK

Streams Review A Review of Streams Mark Boady. What Are Steams? Delayed lists We pretend that the stream is a list In reality we only know the next value,

Streams Review A Review of Streams Mark Boady. What Are Steams? Delayed lists We pretend that the stream is a list In reality we only know the next value,

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google