Hacker News new | ask | show | jobs
by minoru 5130 days ago
When I read that section, it occurred to me that "weak purity" is like monads and "strong purity" is purity as we know it in the FP world. Then drawTriangle() become an action in some monad (I imagined a State one) and renderScene() is just a pure function using some monadic computations (doing something like evalState (drawTriangle ...)).

I don't know how to explain that without analogies to Haskell (which, I presume, author deliberately avoids), though.

1 comments

Yes, I deliberately tried to avoid using FP slang as to not scare away interested C++ programmers. This is also the reason why I referred to I/O »in the classical sense« instead of mentioning the m-word. ;)