I'm sure there are some flaws present in what I've explained - I've simplified out a lot of pain points for learners (like Haskell's IO system for side-effecting functions), and I'm still only a novice myself, so can't comment on what's considered idiomatic. I think the core idea behind it should be correct though :)!