News for hackers. Stuff that matters.
Re:Why functional programming matters (1990) [pdf] by dllthomas on Tuesday May 12, 2015 @08:26AM (#9531192)
It's harder to be confident about impossibility than about possibility, but I think this would require "cheating". I'm not sure if you meant it as a bug, but note that outside of a single-threaded context "pure" isn't referentially transparent - there seems to be a race condition that could lead to pure computing different values if impure is called during pure's execution.

Something with a similar form that would be more realistic to ask for would be a cache for a pure-but-expensive function and some IO operations to inspect/manipulate that cache. I believe you would need a call to unsafePerformIO, but that could be a reasonable thing to do.

Re:Why functional programming matters (1990) [pdf] by mafribe on Tuesday May 12, 2015 @12:39PM (#9532970)
Thanks. I know that "pure" is not thread-safe. I'm quite happy to consider the expressivity of Haskell's monadic approach to effects in a sequential setting first -- much easier to reason about. I wonder if anybody has investigated this expressivity problem. If not, there's an interesting problem waiting to be tackled.
Re:Why functional programming matters (1990) [pdf] by dllthomas on Tuesday May 12, 2015 @02:58PM (#9534047)
I don't see the problem. Pure code being automatically thread-safe is a boon. I would much rather be unable to write thread-unsafe code without noticing (and able to when I deliberately decide to).
Re:Why functional programming matters (1990) [pdf] by mafribe on Wednesday May 13, 2015 @01:19AM (#9536910)
My interest is in proving expressivity results. Such proofs are much easier in a sequential setting. Indeed, at this point I don't even have a strong intuition what exactly the expressivity limitations of Haskell's monadic effect control are.