12
Comments
  • 3
    JavaScript just got yield? Cute.
  • 5
    Indentation 😨😨😨
  • 1
    @Brolls As far as I know, they've had it for a long while.
  • 7
    Here's a Haskell one-liner for you:

    fibList = 0 : 1 : zipWith (+) (fibList) (tail fibList)

    Yes, this is a list of the entire Fibonacci sequence. (I know this is a classic and overused example but couldn't resist lol). It's a very instructive exercise to figure out how this works, it's both lazy and self-referential.
  • 0
    I know the classic way of defining Fibonacci is recursively, but I'm really not a fan of how everyone only write it recursively. It's not the best way and tends to break all the time!
Add Comment