News for hackers. Stuff that matters.
Re:Purity in D by minoru on Monday May 28, 2012 @06:01AM (#4032710)
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.

Re:Purity in D by klickverbot on Monday May 28, 2012 @06:14AM (#4032738)
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. ;)