DEV Community

Enrque\m/Talavera
Enrque\m/Talavera

Posted on

1 1

Chapter 15 and Chapter 16 and chapter 17

Pure functions are memoizable

Memoization is an optimization technique used primarily to speed up computer programs by storing the results of expensive function calls and returning the cached result when the same inputs occur again.

Benefits of pure functions:
-They're easier to reason about
-They're easier to combine
-They're easier to test
-They're easier to debug.
-They're easier to parallelize

Other benefits:
-They're idempotent
-They offer referential transparency
-They are memoizable
-They can be lazy.

"The IO monad does not make a function pure. It just makes it obvious that it's impure".

Pure function signatures tell all.
When a function is pure its signature lets you make very strong guresses at what it does -even when you can't see the function name.

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay