Live data from Hacker News

Why Haskell Is Worth Learning

spin.atomicobject.com

11–20 of 114 posts

Re: Why Haskell Is Worth Learning

#11
post #3

That complex function will turn out to be not all that complex at all; it can be written as just three simple functions composed together! -- Why this requires to learn Haskell, instead of ML or Scheme or Erlang?

The skill of breaking down large functions into smaller simple functions is a common skill of programming and should be practiced in all languages (C, Java, Python, etc). I'm not really sure from the article what I am supposed to gain by learning Haskell. I'm not debating the opinion that Haskell is great language to learn, but the benefits of learning the language were not clear to me after reading the article. Does…

[deleted]

Re: Why Haskell Is Worth Learning

#12
post #4

That complex function will turn out to be not all that complex at all; it can be written as just three simple functions composed together! -- Why this requires to learn Haskell, instead of ML or Scheme or Erlang?

Those are all great languages. Haskell by no means has a monopoly on mind expanding features. But I think that the enforced purity of Haskell along with laziness and the powerful type system is a particularly brain twisting mix.

I believe this too. Presuming that functional programming is a good thing, Haskell is a great way to learn it. It will force you to operate in a functional way all the time, thus speeding up your learning process.

Re: Why Haskell Is Worth Learning

#13
post #3

That complex function will turn out to be not all that complex at all; it can be written as just three simple functions composed together! -- Why this requires to learn Haskell, instead of ML or Scheme or Erlang?

The skill of breaking down large functions into smaller simple functions is a common skill of programming and should be practiced in all languages (C, Java, Python, etc). I'm not really sure from the article what I am supposed to gain by learning Haskell. I'm not debating the opinion that Haskell is great language to learn, but the benefits of learning the language were not clear to me after reading the article. Does…

"The skill of breaking down large functions into smaller simple functions is a common skill of programming and should be practiced in all languages (C, Java, Python, etc)"

Haskell will show you that when you thought you broke your code down into small functions in those languages, you were wrong in ways you currently can't even see and they're still shot through with duplication and mixing of concerns.

This is really the core of the "it changes how you program"; the environments you mention are so full of conflation of IO and mutation and state that you don't even see it, because it's just the way it is. Haskell will ungently pry those apart for you, if you stick around long enough to actually become proficient. You can take this back into other programming languages where this separation is not enforced, but I'm not convinced you can learn it where it is not enforced. The feedback cycle is so direct in Haskell ("Type Error: ...") and so diffuse in other languages (two months later "Aw crap, I should have isolated IO from non-IO better...").

(Oh you think that last parenthetical is a joke? Ha! I wish.)

Re: Why Haskell Is Worth Learning

#14

That complex function will turn out to be not all that complex at all; it can be written as just three simple functions composed together! -- Why this requires to learn Haskell, instead of ML or Scheme or Erlang?

I'm no expert, but I think Haskell is the most practical of the non-practical languages.

Re: Why Haskell Is Worth Learning

#15
post #13
post #3

Earlier quoted context omitted.

The skill of breaking down large functions into smaller simple functions is a common skill of programming and should be practiced in all languages (C, Java, Python, etc). I'm not really sure from the article what I am supposed to gain by learning Haskell. I'm not debating the opinion that Haskell is great language to learn, but the benefits of learning the language were not clear to me after reading the article. Does…

"The skill of breaking down large functions into smaller simple functions is a common skill of programming and should be practiced in all languages (C, Java, Python, etc)" Haskell will show you that when you thought you broke your code down into small functions in those languages, you were wrong in ways you currently can't even see and they're still shot through with duplication and mixing of concerns. This is really…

Thank you (and jochu and pilgrim689) for elaborating on this. I hope to take the plunge at some point and learn Haskell! It seems like an interesting perspective on programming.

Re: Why Haskell Is Worth Learning

#16
I was thinking about this the other day and I think it generalizes beyond any specific language. I'm pretty sure every time I have learned a new programming language I came away a better programmer. Different programming languages (and their standard libraries) suggest that you approach problems in different ways, and that has real cognitive benefits.

I was actually trying to think if there was ever a case where I had spent time learning a language (or library) that didn't pay some sort of dividend in terms of increasing my skill as a programmer.

Re: Why Haskell Is Worth Learning

#17
I investigated Haskell for a while and as long as I didn't try to add any libs it was fun. However once I started using cabal to try and manage dependencies all hell broke loose. Obviously it takes a while to get it right (looking at you SBT and Ruby gems) but Haskell has been around forever.

Re: Why Haskell Is Worth Learning

#18
post #17

I investigated Haskell for a while and as long as I didn't try to add any libs it was fun. However once I started using cabal to try and manage dependencies all hell broke loose. Obviously it takes a while to get it right (looking at you SBT and Ruby gems) but Haskell has been around forever.

I'm writing 3 different web apps, plus some command line tools in haskell. I have been working on these projects for a year now, and I've never seen any cabal problems that aren't typical problems that occur with any package manager (trying to install conflicting modules).

    $ ghc-pkg list | wc -l
         182

Re: Why Haskell Is Worth Learning

#19
post #17

I investigated Haskell for a while and as long as I didn't try to add any libs it was fun. However once I started using cabal to try and manage dependencies all hell broke loose. Obviously it takes a while to get it right (looking at you SBT and Ruby gems) but Haskell has been around forever.

I'm writing 3 different web apps, plus some command line tools in haskell. I have been working on these projects for a year now, and I've never seen any cabal problems that aren't typical problems that occur with any package manager (trying to install conflicting modules). $ ghc-pkg list | wc -l 182

I felt that way up until last week! I somehow felt I was special, that cabal-hellfires had burnt a ring around me. Then next thing I knew I had a 4 page cabal conflict problem and had to just toast .ghc and .cabal and start over.

It's a real problem.

Re: Why Haskell Is Worth Learning

#20
post #16

I was thinking about this the other day and I think it generalizes beyond any specific language. I'm pretty sure every time I have learned a new programming language I came away a better programmer. Different programming languages (and their standard libraries) suggest that you approach problems in different ways, and that has real cognitive benefits. I was actually trying to think if there was ever a case where I ha…

The point about learning Haskell in particular is that it's a way different different language. It's a single language that gives you exposure to a lot of new ideas: purity, laziness, modern type systems, functors, monads, monoids, etc.
Post reply on HN