Lazy Evaluation in Python

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ก.ค. 2024
  • Python Code: gist.github.com/phagenlocher/...
    Java Code: gist.github.com/phagenlocher/...
    Timestamps:
    00:00 - What is Lazy Evaluation?
    01:42 - Functions and Thunks
    03:29 - The Lazy Class
    08:27 - Factorials Done Lazily
    09:29 - A List of Lazy
    10:12 - Infinite Lists
    11:59 - A Whole Lotta Generators
    15:00 - Some Considerations
    Support me on Ko-fi:
    ko-fi.com/phagenlocher
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 10

  • @Fanaro
    @Fanaro 3 ปีที่แล้ว +3

    "Type Juggling" is the jargon I was missing out on for years.

  • @peterm8808
    @peterm8808 3 ปีที่แล้ว +2

    Indeed I didn't expect the spanish inquisition in this video, nice reference

  • @user-fp6dt1os1l
    @user-fp6dt1os1l 3 ปีที่แล้ว +4

    By the way, Python has built-ins that basically do what `lfilter` and `lmap` do, and many more similar things in the `itertools` module.

  • @Daniel-ws9qu
    @Daniel-ws9qu 3 ปีที่แล้ว +2

    Much knowledge in few sentences!

  • @lasdjfidkdkeidek3i3
    @lasdjfidkdkeidek3i3 3 ปีที่แล้ว +2

    Awesome videos! Can you do one on build tools/package management and how they relate to raw ghc and each other? E.g. cabal/stack/nix/hackage/etc

    • @philipphagenlocher
      @philipphagenlocher  3 ปีที่แล้ว +3

      It's unlikely that I will cover tools. That has multiple reasons:
      1.) It would only make sense to cover tools that I use myself and generally I am avoiding most of them. I just don't like to have many dependencies in a project.
      2.) I don't think I could provide any information that isn't already presented in the user manuals.
      3.) Tools can (and often do) change over time, so a video could become outdated in a matter of months from publication.

    • @lasdjfidkdkeidek3i3
      @lasdjfidkdkeidek3i3 3 ปีที่แล้ว +3

      ​@@philipphagenlocher Sure. That's understandable. Out of curiosity how do you avoid pulling in dependencies and how do you handle them then when you do need them? I'm in the initial phases of writing something that generates PDFs as a starter project in haskell and already I've had to pull in a handful (probably understandable considering the domain of the problem). As a new user, I was a bit overwhelmed initially by the build ecosystem in haskell. I decided to *only* use cabal as it seemed the most simple case (as opposed to using cabal AND some other tools as some developers seem like to do). However, being new its not totally clear to me how cabal interacts with ghc(i). Maybe what I'm lacking really is a full understanding of how ghc works.
      Anyway, thanks for taking the time to give such a detailed response and for the fantastic videos! They are a godsend to new haskell'ers like me. Keep the good work :)

  • @aniruddharora4004
    @aniruddharora4004 3 ปีที่แล้ว +1

    Can you make a series on python just as you have done on haskell? The haskell series was very helpful.

  • @SebastianSipos
    @SebastianSipos 3 ปีที่แล้ว +1

    but... haskell...