functional programming

If Functional Programming, Simplified seems large ... alvin December 2, 2019 - 7:46am

If Functional Programming, Simplified seems large, a) I intentionally wrote it in a simple, leisurely style, and b) it’s a lot easier than reading hundreds of blog posts and all of those books on the right (although a few of those books are really good).

Functional Programming, Simplified — PDF version price reduced alvin November 24, 2019 - 3:07pm

SALE: I’ve lowered the price of the PDF version of Functional Programming, Simplified to $20 for the 2019 holiday season. I don’t know when I’ll increase it again, but the usual selling price is as high as $35.

Scala: What do “effect” and “effectful” mean in functional programming?

When you get started with functional programming (FP) a common question you’ll have is, “What is an effect in functional programming?” You’ll hear advanced FPers use the words effects and effectful, but it can be hard to find a definition of what these terms mean.

What your source code looks like when you can’t pass functions around (i.e., without higher-order functions)

I initially thought you couldn’t pass functions around in Dart (you can!), so I had to remember what we used to have to do with interfaces and inheritance. (See the image.)

Put another way, when you have the ability to pass functions into functions, it eliminates this kind of code interface/inheritance code.

Think of the Scala collections’ map method as “transform” alvin September 18, 2019 - 1:00pm

I’ve written this before, but when I saw this “pseudocode to Scala code” example in the book Functional Thinking, I thought it was worth mentioning again: If you have trouble grokking the Scala map method, think of it as being named transform instead. It transforms an input collection to an output collection, based on the algorithm you supply.

For those coming from the OOP world, I think “transform” is a better word because it is more meaningful, at least initially.

FP is not about not having side effects at all

“I though it was obvious, but apparently it's not. FP is not about not having side effects at all, otherwise it would be useless. It's just about deferring them for as long as possible, that's all.”

~ Alessandro Lacava, in this tweet

A Scala “functional programming style” To-Do List application written with Cats

Back when I was writing Functional Programming, Simplified I started to write a little Scala/FP “To-Do List” application that you can run from the command line, based on a similar application in the Learn You A Haskell For Great Good book. For reasons I don’t remember, I decided not to include it in the book, and forgot about it until I started using GraalVM (“Graal”) recently.

The Science of Functional Programming (book) alvin August 10, 2019 - 10:41am

I haven’t read this yet, but here’s a link to an electronic version of a free book titled, The Science of Functional Programming. Who knows, it may one day have an impact on my book, Functional Programming, Simplified.