You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
-
5Your point about memoization is very good. Note that Haskell strongly emphasizes referential transparency for programming, but the memoization-like behavior of lazy evaluation involves a staggering amount of mutation being done by the language runtime behind the scenes.C. A. McCann– C. A. McCann2013-04-25 19:08:58 +00:00Commented Apr 25, 2013 at 19:08
-
1@C. A. McCann: I think what you say is very important: in a functional language the runtime can use mutation to optimize the computation but there is not construct in the language that allows the programmer to use mutation. Another example is a while loop with a loop variable: in Haskell you can write a tail recursive function that may be implemented with a mutable variable (to avoid using the stack), but what the programmer sees are immutable function arguments that are passed from one call to the next.Giorgio– Giorgio2013-04-26 05:21:53 +00:00Commented Apr 26, 2013 at 5:21
-
@Michael Shaw: +1 for "The problem isn't mutability per se, it's a lack of referential transparency." Maybe you can cite the Clean language in which you have uniqueness types: these allow mutability but still guarantee referential transparency.Giorgio– Giorgio2013-04-26 08:33:31 +00:00Commented Apr 26, 2013 at 8:33
-
@Giorgio: I don't really know anything about Clean, although I've heard it mentioned from time to time. Maybe I should look into it.Michael Shaw– Michael Shaw2013-04-26 12:07:07 +00:00Commented Apr 26, 2013 at 12:07
-
@Michael Shaw: I do not know very much about Clean, but I know that it uses uniqueness types to ensure referential transparency. Basically, you can modify a data object provided that after the modification you have no references to the old value. IMO this illustrates your point: referential transparency is the most important point, and immutability is only one possible way of ensuring it.Giorgio– Giorgio2013-04-26 14:51:34 +00:00Commented Apr 26, 2013 at 14:51
Add a comment
|
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
-
create code fences with backticks ` or tildes ~
```
like so
``` -
add language identifier to highlight code
```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible)
<https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. design-patterns), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you