
On Thu, 13 Aug 2009, Heinrich Apfelmus wrote:
Russell O'Connor wrote:
Peter Verswyvelen wrote:
I kind of agree with the DDC authors here; in Haskell as soon as a function has a side effect, and you want to pass that function to a pure higher order function, you're stuck, you need to pick the monadic version of the higher order function, if it exists. So Haskell doesn't really solve the modularity problem, you need two versions of each higher order function really,
Actually you need five versions: The pure version, the pre-order traversal, the post-order traversal, the in-order traversal, and the reverse in-order traversal. And that is just looking at syntax. If you care about your semantics you could potentially have more (or less).
Exactly! There is no unique choice for the order of effects when lifting a pure function to an effectful one.
Which proves the proposition (courtesy of Johannes Waldmann), again: If a problem is more difficult to solve in Haskell than in another language, this is not Haskell's fault, but it is because the tackled problem is difficult and the other language only hides the problem. :-)