Live data from Hacker News

What I Wish I Knew When Learning Haskell

dev.stephendiehl.com

1–10 of 24 posts

Re: What I Wish I Knew When Learning Haskell

#2
I wish I knew what changed from the last time this was posted 2 months ago: https://news.ycombinator.com/item?id=7637278

Also I believe last time Stephen was surprised folks had gotten a hold of content on his "pre-prod" domain (e.g. http://dev.stephendiehl.com/), because he was still working on that post, before it was ready.

I like points as much as the next person, but maybe "pre-release" content should not be posted to aggregreators like HN before they are "realeased"

That said I'm excited he's continuing to update this series, it's helped a lot of people and there is a ton for me to learn still!

Re: What I Wish I Knew When Learning Haskell

#3
post #2

I wish I knew what changed from the last time this was posted 2 months ago: https://news.ycombinator.com/item?id=7637278 Also I believe last time Stephen was surprised folks had gotten a hold of content on his "pre-prod" domain (e.g. http://dev.stephendiehl.com/ ), because he was still working on that post, before it was ready. I like points as much as the next person, but maybe "pre-release" content should not be po…

It appears to be twice as long as the old 2.0 version, and a lot of the latest GHC 7.8 topics which wasn't released before the last version.

Re: What I Wish I Knew When Learning Haskell

#4
I have to say that this line irks me: "Any preconceptions one might have for the word 'return' should be discarded, it has an entirely different meaning."

This sentence literally does nothing to help me even prepare to understand what is about to be explained. At the least, give a small example of what preconceptions should go. "All of them" implies that someone did a crap job of naming this thing.

Edit: Apologies to all responses. I responded to two, but I'm not sure I have different responses for each. If it seems I've ignored some aspect, apologies.

Re: What I Wish I Knew When Learning Haskell

#6
post #3
post #2

I wish I knew what changed from the last time this was posted 2 months ago: https://news.ycombinator.com/item?id=7637278 Also I believe last time Stephen was surprised folks had gotten a hold of content on his "pre-prod" domain (e.g. http://dev.stephendiehl.com/ ), because he was still working on that post, before it was ready. I like points as much as the next person, but maybe "pre-release" content should not be po…

It appears to be twice as long as the old 2.0 version, and a lot of the latest GHC 7.8 topics which wasn't released before the last version.

That's helpful, thanks

Re: What I Wish I Knew When Learning Haskell

#7
post #2

I wish I knew what changed from the last time this was posted 2 months ago: https://news.ycombinator.com/item?id=7637278 Also I believe last time Stephen was surprised folks had gotten a hold of content on his "pre-prod" domain (e.g. http://dev.stephendiehl.com/ ), because he was still working on that post, before it was ready. I like points as much as the next person, but maybe "pre-release" content should not be po…

> I wish I knew what changed from the last time this was posted 2 months ago: https://news.ycombinator.com/item?id=7637278

Reposts may not be encouraged but it gives the chance for new followers and those who missed seeing this post before. Not to mention the added karma for the poster.

On the other hand, for the sake of others, who don't know, please visit http://hn.algolia.com to check if something's already been posted!

Re: What I Wish I Knew When Learning Haskell

#8
post #4

I have to say that this line irks me: "Any preconceptions one might have for the word 'return' should be discarded, it has an entirely different meaning." This sentence literally does nothing to help me even prepare to understand what is about to be explained. At the least, give a small example of what preconceptions should go. "All of them" implies that someone did a crap job of naming this thing. Edit: Apologies to…

Maybe there is some deep mathematical reason why 'return' is named as such, but I suspect the person who gave it that name was trying (perhaps a bit too hard) to make monadic code appear even more like the imperative code to which most of us are accustomed.

More or less by coincidence, 'return' tends to appear in the same places you would see the 'return' statement in C and derived languages. But the purpose of the 'return' function in Haskell is quite different from the 'return' statement.

Re: What I Wish I Knew When Learning Haskell

#9
post #4

I have to say that this line irks me: "Any preconceptions one might have for the word 'return' should be discarded, it has an entirely different meaning." This sentence literally does nothing to help me even prepare to understand what is about to be explained. At the least, give a small example of what preconceptions should go. "All of them" implies that someone did a crap job of naming this thing. Edit: Apologies to…

All of them. return "lifts" a "plain" value so that it becomes a "monadic" thing. As far as I can see, this has nothing at all to do with returning a value from a function.

Re: What I Wish I Knew When Learning Haskell

#10
post #4

I have to say that this line irks me: "Any preconceptions one might have for the word 'return' should be discarded, it has an entirely different meaning." This sentence literally does nothing to help me even prepare to understand what is about to be explained. At the least, give a small example of what preconceptions should go. "All of them" implies that someone did a crap job of naming this thing. Edit: Apologies to…

That sentence could have more information, but I think it still serves a worthwhile purpose. It's basically saying that, for now, think of "return" as a new thing you've never seen before and don't worry about correlating it with what you already have seen in other languages.

In Haskell, 'return' creates a monadic value. Here are some excerpts from Learn You A Haskell for Great Good:

> If you've done imperative languages like C, Java or Python, you're probably thinking that you know what this return does and chances are you've already skipped this really long paragraph. Well, here's the thing: the return in Haskell is really nothing like the return in most other languages! It has the same name, which confuses a lot of people, but in reality it's quite different. In imperative languages, return usually ends the execution of a method or subroutine and makes it report some sort of value to whoever called it. In Haskell (in I/O actions specifically), it makes an I/O action out of a pure value. If you think about the box analogy from before, it takes a value and wraps it up in a box. The resulting I/O action doesn't actually do anything, it just has that value encapsulated as its result.

...

> return is sort of the opposite to http://learnyouahaskell.com/input-and-output

Post reply on HN