SHARE
TWEET

CS6 W8 L1 Hakell and Lazy Evaluation 8

wiley_pastebin Jan 13th, 2020 (edited) 185 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. x^2 + 4*x + 4 where x = fibs !! 1000 `mod` 17        --Haskell evaluates a sum left to right. Haskell needs to know what x is
  2. x^2 + 4*x + 4 where x = 13       -- the result of Haskell evaluating x
  3. 13^2 + 4*x + 4 where x = 13      -- Haskell can now plug the value of x in every time the value is needed
  4. 169 + 4*x + 4 where x = 13
  5. 169 + 4*13 + 4 where x = 13
  6. 169 + 52 + 4 where x = 13
  7. 225 where x = 13
  8. 225
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top