News for hackers. Stuff that matters.
Re:When Functional Programming Isn't Functional by yomritoyj on Monday April 02, 2018 @01:32AM (#16732543)
Syntax matters. What I really like about Haskell is how much care has been given to the syntax to make functional idioms easy to read and write. One can just say,

    fib = 0:1:zipWith (+) fib (drop 1 fib)
[I know that `drop 1` is just `tail`, but this one makes the intent clearer for those who may not know Haskell].
Re:When Functional Programming Isn't Functional by ubernostrum on Monday April 02, 2018 @03:22AM (#16732919)
You can often get close to Haskell-y implementations in Python with help from the itertools module. There are a couple "Haskell style" Fibonacci generators with itertools floating around in blog posts, I'm sure, and I've used itertools to write all sorts of things in a pretty succinct manner.
Re:When Functional Programming Isn't Functional by Zpalmtree on Monday April 02, 2018 @03:21AM (#16732911)
Technically drop 1 isn't just tail, but it doesn't matter in this example. Tail will error on an empty list.