https://jerf.org/iri/post/2025/fp_lessons_purity/ may help, perhaps even especially if you are not a functional programmer.
See also https://jerf.org/iri/post/2958/ .