Skip to content

Instantly share code, notes, and snippets.

View yannick-cw's full-sized avatar

Yannick Gladow yannick-cw

View GitHub Profile
@yannick-cw
yannick-cw / shared-state-in-fp.md
Created November 17, 2018 08:34 — forked from gvolpe/shared-state-in-fp.md
Shared State in pure Functional Programming

Shared State in pure Functional Programming

Newcomers to Functional Programming are often very confused about the proper way to share state without breaking purity and end up having a mix of pure and impure code that defeats the purpose of having pure FP code in the first place.

Reason why I decided to write up a beginner friendly guide :)

Use Case

We have a program that runs three computations at the same time and updates the internal state to keep track of the