
To elaborate there is another language that is also a functional language. I won't mention the name so as not to offend anyone. It too is effect free, that is what makes it functional and it is a functional language in the true sense of the term, but it is not effect free in the sense that Haskell is effect free. This other language is effect free in every practical sense whereas Haskell is effect free in a strict sense.

On Thu, Dec 10, 2009 at 4:15 PM, John D. Earle
To elaborate there is another language that is also a functional language. I won't mention the name so as not to offend anyone. It too is effect free, that is what makes it functional and it is a functional language in the true sense of the term, but it is not effect free in the sense that Haskell is effect free. This other language is effect free in every practical sense whereas Haskell is effect free in a strict sense.
Why would anyone be offended? I'd prefer if you tried to be clear about what you mean, rather than intentionally obscure your points to avoid causing offence. Be specific. What language? How is it different than Haskell w.r.t. purity? -- Sebastian Sylvan

In fairness to John, his trying really hard to avoid causing offense might having something to do with the fact that he just had a couple dozen or so e-mails attacking him personally the last time he tried asking questions about Haskell and comparing it to O'Caml. I have to confess that I myself had thought at the time that he was being a troll --- i.e., in this case a person who shows up on a mailing list of fans of a language and attacks it just to create a fuss --- since he had not only pointed out reasons why the language is flawed (which is not in itself unreasonable, as long as it is being done in a constructive manner), but asked us to prove that it *wasn't* flawed, and said things that implied that we only liked it because we had never seriously looked at any other language. However, his recent e-mails on this have shown a serious willingness to really try to understand more about Haskell. Thus, perhaps there may have simply been a miscommunication/misunderstanding earlier. Cheers, Greg On Dec 10, 2009, at 8:47 AM, Sebastian Sylvan wrote:
On Thu, Dec 10, 2009 at 4:15 PM, John D. Earle
wrote: To elaborate there is another language that is also a functional language. I won't mention the name so as not to offend anyone. It too is effect free, that is what makes it functional and it is a functional language in the true sense of the term, but it is not effect free in the sense that Haskell is effect free. This other language is effect free in every practical sense whereas Haskell is effect free in a strict sense. Why would anyone be offended? I'd prefer if you tried to be clear about what you mean, rather than intentionally obscure your points to avoid causing offence. Be specific. What language? How is it different than Haskell w.r.t. purity?
-- Sebastian Sylvan _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

My understanding of functional programming is that nearly everything is a
function, and that evaluation of those functions is how programs are
written. Functional programming languages treat functions as first class
values, allowing them to be passed to other functions and returned from
functions.
In this sense Scheme qualifies as a functional language. However Scheme
will fail your definition because you're saying it must be effect free,
which is not the case with Scheme.
It becomes difficult to have a discussion when the fundamental terms are not
agreed upon :-)
Dave
On Thu, Dec 10, 2009 at 8:15 AM, John D. Earle
To elaborate there is another language that is also a functional language. I won't mention the name so as not to offend anyone. It too is effect free, that is what makes it functional and it is a functional language in the true sense of the term, but it is not effect free in the sense that Haskell is effect free. This other language is effect free in every practical sense whereas Haskell is effect free in a strict sense.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

I won't mention the name so as not to offend anyone.
Oh I'm sure we can handle it ;)
Though I'm curious as to how a language could be effect free in a practical
sense, but not a strict one? could you give an example?
To answer your original question, there are many benefits haskell gains from
being a pure language. (And by pure I mean that functions have no side
effects, they can only give data to their environment via their return
value). I think the my biggest reason (though there are probably others) is
as follows:
Pure code is easier to reason about than impure code:
When I program for work (we use ada, ick) and I find that a function is
returning a bad result it is very difficult to figure out where the
malfunction is. Is the function itself the problem? incorrect parameters?
some global flags setup incorrectly? Did I need to call another function to
setup state before I called this one? In a pure language I can just check
the function inputs. Are they good? if yes, then the problem is in the
function, if no, then follow the value up the chain, etc...
A simpler case would be a single variable in a large function. Say I trace
a bug down to a bad value in a particular variable in a big function. I have
to look at every place that the variable is modified in the function as well
as any places where the variable is passed to other functions by reference
_as well as_ the control flow from those mutations to the usage of the
variable in question. In a pure language If a variable doesn't have the
correct value I check the definition (there can only be one)
Data flow in a pure language is so much easier to follow/understand and you
never have to worry about the order of execution (which is what makes it
easy to implement lazy evaluation).
I have literally debugged _hundreds_ of errors in our codebase at work that
would _not have even been possible_ in a pure language.
The downside to purity is that sometimes it's slower (though this is
becoming less and less of an issue, sometimes it's even faster) and
sometimes it's much easier to mutate some state than pass a value back up a
big chain. But overall I much prefer purity, it make my life so much easier.
- Job
On Thu, Dec 10, 2009 at 11:15 AM, John D. Earle
To elaborate there is another language that is also a functional language. I won't mention the name so as not to offend anyone. It too is effect free, that is what makes it functional and it is a functional language in the true sense of the term, but it is not effect free in the sense that Haskell is effect free. This other language is effect free in every practical sense whereas Haskell is effect free in a strict sense.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (5)
-
David Leimbach
-
Gregory Crosswhite
-
Job Vranish
-
John D. Earle
-
Sebastian Sylvan