3 ms·
>All languages I know (e.g. Haskell) make concessions to pragmatism. For example, even pure function can somehow create debug output. From the Debug.Trace docs
by wyager 12y ago
>All languages I know (e.g. Haskell) make concessions to pragmatism. For example, even pure function can somehow create debug output.
From the Debug.Trace docs: "should not be used in production code."
>Every memory allocation does mutate global state.
Yes, Haskell is approximately pure just like computers are approximately Turing machines. Computers are technically FSMs, but they're practically so close to Turing machines that we usually don't care. Haskell is so close to pure that we don't care. It's also guaranteed to be semantically pure, until you start to run into those edge cases where computers don't act like Turing machines (i.e. when you run out of RAM).
>It removes the need allocate a return image or wrap computations in monads and thunks.
No one is arguing that impurity/mutability is (frequently) useful. I'm just arguing that it's disingenuous to call what you've described "pure", or that this extra "purity" is very useful.
- deleted 12y ago[deleted]