L12: Folding over Lists

Поділитися
Вставка
  • Опубліковано 7 лют 2025

КОМЕНТАРІ • 6

  • @NedaAbdolrahimi-e1w
    @NedaAbdolrahimi-e1w Рік тому

    I laughed a lot in the motorcycle part :)))) and learned a lot from the tutorial. Thank you for spending a lot of time on these videos.

  • @crfout1
    @crfout1 7 місяців тому

    In the use of the custom fold function, the lambda form is distracting and unnecessary. The custom fold function is already designed to properly use a binary function as an argument.
    Instead of:
    (fold (lambda (next-element acc) (+ next-element acc)) 0 lst)
    Use:
    (fold + 0 lst)

    • @krismicinski
      @krismicinski  7 місяців тому

      @@crfout1 I don’t think it’s much different: one is eta expanded, and it’s not a big insight to say that eta expanding is different. Respectfully: this is just an aesthetic difference, and not as important as you are implying. Eta expansion is discussed later and this example here is used to motivate it

    • @crfout1
      @crfout1 6 місяців тому

      @@krismicinski Is teaching unnecessary complexity the right thing to do? Generic styles can be great, but only after the students understand what "folding over a list" actually means. At least explain up front that the much longer and more complicated version has a different purpose.

    • @krismicinski
      @krismicinski  6 місяців тому

      @@crfout1 thanks for the criticism, it is appreciated as I work on the next iteration of the course

    • @crfout1
      @crfout1 6 місяців тому

      @@krismicinski I thoroughly enjoyed the UA-cam accessible portion of your course. Thanks for posting it here!