~/talk

Lazy Evaluation

Talkat ZuriHac 2023 · 2023-06-10..06-12· [functional-programming]
slides:none on file

Three hours of worked examples show how Haskell’s lazy, outermost reduction (weak head normal form) really behaves: null on an enum is constant space, selfEqual forces linear time but not residency, map stays incremental while reverse builds the whole spine, and naive length leaks until an accumulator gets a bang pattern. Measurement uses GHC -s stats and ghci sprint/print; collected numbers show small overheads and a maximum residency 44k baseline. Partitioning into two lists and the Writer pattern are shown to be inherently leaky; GHC’s demand analyzer helps but cannot be fully trusted.

AI-written summary · about

  1. 0:00Lazy evaluation intro
  2. 1:04Well-Typed Haskell consultancy
  3. 3:35Speaker background
  4. 8:56What is lazy evaluation
  5. 14:15First example: null function
  6. 36:23Demand propagation and WHNF
  7. 51:07Strictness in Haskell
  8. 1:04:44Break announcement
  9. 1:05:26Second example: null via equality
  10. 1:12:11Third example: self-equality and sharing
  11. 1:33:16Sharing and CAFs in Haskell
  12. 1:40:32Debugging with sPrint and print in GHCi
  13. 1:53:40Fourth example: map reverse with null
  14. 2:00:05Fifth example: null via length
  15. 2:10:58Bang patterns and strict accumulators
  16. 2:23:17Demand analyzer and optimizations
  17. 2:28:01Final example: partition and space leaks
  18. 2:34:42Conclusion and Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.