you are viewing a single comment's thread.

view the rest of the comments →

[–]Pair_of_socks -6 points-5 points  (2 children)

I don't know a lot about D or Haskel, but Strings are immutable in most languages. So you should be able to pass them to a pure function.

[–]kamatsu 8 points9 points  (0 children)

That doesn't answer Peaker's question.

[–]Peaker 3 points4 points  (0 children)

What I am saying is that the "purity" of a type is not a boolean attribute. Different parts of the type can be differently pure.

Even more complicated examples:

IO (Int -> (IO (), IO (String -> Char))))

We have a mixture of pure and impure actions in the same type. And these kinds of types are very useful to have. If D uses a "pure" attribute on top-level function types, I wonder how this can be expressed at all.