This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
cs330_f2016:labx [2016/06/15 20:52] dcostello |
cs330_f2016:labx [2016/06/21 22:33] dcostello |
||
---|---|---|---|
Line 30: | Line 30: | ||
-- Examples | -- Examples | ||
- | (build_infinite_list *x) = [2,4,6,8,...] | + | (build_infinite_list (*2)) = [2,4,6,8,...] |
</code> | </code> | ||
Lazily constructs an infinite list such that list!!i returns (f i). | Lazily constructs an infinite list such that list!!i returns (f i). | ||
Line 56: | Line 56: | ||
</code> | </code> | ||
- | ==fastIsPrime== | + | ==isPrimeFast== |
<code haskell> | <code haskell> | ||
-- Type Signature | -- Type Signature | ||
- | fastIsPrime :: Integer -> bool | + | isPrimeFast :: Integer -> bool |
</code> | </code> | ||
- | Takes an integer n and returns true if n is prime. **Only test prime factors from fastPrimes.** | + | Takes an integer n and returns true if n is prime. **Only test prime factors from primesFast.** |
- | ==fastPrimes== | + | ==primesFast== |
<code haskell> | <code haskell> | ||
-- Type Signature | -- Type Signature | ||
- | fastPrimes :: [Integer] | + | primesFast :: [Integer] |
</code> | </code> | ||
- | Create an infinite list of all primes and name it fastPrimes. **Must be constructed with fastIsPrime.** | + | Create an infinite list of all primes and name it primesFast. **Must be constructed with isPrimeFast.** |
===Part 3: Longest Common Sub-sequence=== | ===Part 3: Longest Common Sub-sequence=== |