
Purity in D - klickverbot
http://klickverbot.at/blog/2012/05/purity-in-d/
======
Rickasaurus
I was disappointed by the '›Weak‹ Purity Allows for Stronger Guarantees'
section. I expected an explanation of why weak purity might give stronger
guarantees, but what I got was a set of reasons why weak purity is more
practical for a compiler that can't handle FP optimizations. Where's the
stronger guarantees?

~~~
minoru
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.

~~~
klickverbot
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. ;)

------
klickverbot
I am the author of the linked article – feedback and comments of any kind are
very welcome!

~~~
minoru
There is an issue with quotes — they appear to be swapped (tiny screenshot
here: <http://ompldr.org/vZHl4Mw>). I made a little check, it's the same with
every font you specified in your CSS, so the problem must lie within your blog
generator or something.

~~~
klickverbot
In German, guillemets are actually only used like that – contrary to, for
example, French. I got in the habit of using them almost exclusively, and
usually enter them explicitly (most non-Windows keyboard layouts have them in
a convenient location). If this is confusing to non-German readers, though, I
suppose I should reconsider their use.

~~~
minoru
Oh, I didn't know that — thanks! But yes, to me it looked like I had some
fonts wrong or something.

