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.
-
No, I don't mean a null reference exception. In all the languages I know uninitialized but declared variables are some form of null.user7146– user71462011-05-23 22:57:43 +00:00Commented May 23, 2011 at 22:57
-
But your question was not about uninitialized variables. And there are languages that do not use null for uninitialized variables, but instead use wrapper objects that can optionally contain a value -- Scala and Haskell, for example.Jim Balter– Jim Balter2011-05-23 23:21:57 +00:00Commented May 23, 2011 at 23:21
-
1"...but instead use wrapper objects that can optionally contain a value." Which is clearly nothing like a nullable type.Aaronaught– Aaronaught2011-05-24 00:05:54 +00:00Commented May 24, 2011 at 0:05
-
1In haskell there is no such thing as an uninitialized variable. You could potentially declare an IORef and seed it with None as an initial value but that's pretty much the analog of declaring a variable in some other language and leaving it uninitialized which brings with it all the same problems. Working in the purely functional core outside the IO monad haskell programmers have no recourse to reference types so there is no null reference problem.user7146– user71462011-05-24 00:37:52 +00:00Commented May 24, 2011 at 0:37
-
1If you have an exceptional "Missing" value, that is precisely the same as an exceptional "null" value - if you have the same tools available to handle it. That's a significant "if". You need extra complexity to handle that case either way. In Haskell, pattern matching and the type system provides a way to help manage that complexity. However, there are other tools for managing complexity in other languages. Exceptions are one such tool.user8709– user87092011-05-24 04:09:10 +00:00Commented May 24, 2011 at 4:09
|
Show 3 more comments
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