~/talk

Function Reuse is just Wishful Thinking

Talkat ScalaCon 2022 · 2022-10-04..10-07· [scala, functional-programming]
slides:none on file

A concrete claim: reuse comes from abstracting the wrapping context, not reprinting functions for each case. Using Scala typeclasses and simple combinators—wishful thinking by declaring needed ops—this builds lift, lift2 (via currying and a split/apply), flip for List/F interop, flatten/flatMap and ultimately an applicative+flatMap = monad. The example is a PS5 crawler: affordable, cheapest, totalCostF, itemSeller and reviews are sketched and composed; each step compiles conceptually and requires the corresponding typeclass constraints, so the approach works end to end.

AI-written summary · about

  1. 0:00Introduction and motivation
  2. 3:10Problem with context wrappers
  3. 7:05Wishful thinking in design
  4. 12:05Introducing functors
  5. 15:37Lifting functions with functors
  6. 18:07Introducing applicatives
  7. 21:12Applicative operations
  8. 25:33Total cost with applicatives
  9. 28:43Pure and applicative summary
  10. 30:08Filtering scam items
  11. 33:58Introducing flatten
  12. 36:27FlatMap and monads
  13. 43:15Monad summary
  14. 43:57Recap and closing
  15. 45:20Q&A session
~/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.