Live data from Hacker News

Why Haskell Is Worth Learning

spin.atomicobject.com

71–80 of 114 posts

Re: Why Haskell Is Worth Learning

#71
post #62

I will learn Haskell if you people will stop spamming me about it.

I dunno, even on here it gets less press than Python, Ruby or even Go. It's just since most people already know imperative programming well, the Python/Ruby/Go articles that get upvoted tend to be a bit more advanced.

Will you stop using Python? Or would you not learn Python?

Re: Why Haskell Is Worth Learning

#72
post #7

Earlier quoted context omitted.

At university the very first language we are taught is Haskell. Lots of people had never programmed before, in anything and everyone managed fine. Nothing scary at all, no need for an understanding of category theory or anything. Monads are (fairly) simple things that just have a really bad reputation, partly the fault of the haskell docs which make them seem complex. Firstly: Functors are things we can map over in a…

Monads are fairly easily expressed in mathematics but trying to explain them conversationally appears to be an exercise in futility. There are dozens or hundreds of these explanations on the Internet and haven't seen one that hasn't been declared so wrong by the ones-who-know. (edit: and I'm not one-who-knows but I'm pretty sure "side effects might happen here" falls in this category). Classes, objects, functions, an…

I don't know, my dinner table explanation of monads has always been that they are DSLs. Even the Gentle Introduction offers this viewpoint (it develops a DSL in Haskell, as a monad, for writing resourceful computations, that is, computations which consume some user-definable resource at each step and automatically suspend upon consumption of all available resources).

After all, one of the philosophies of software development is that you're essentially building up your application as a layer of languages, each of which uses the constructs of the language beneath it as its own primitives, until at the highest level you have what is nothing more or less than a language built from the ground up to express the actions of your application in the simplest terms.

You can write a lot of Haskell software without ever delving much more into monads than what I just wrote. It's really that easy. Monad transformers also tend to scare people, but that is silly. A monad transformer just takes the DSL that you've already made with your current monad and it adds in new language features and functionality for you automatically. That's all.

Re: Why Haskell Is Worth Learning

#73
post #9
post #8

I am no Haskell expert, so I might be wrong on this, but is that code right ? I would imagine the fourth line should read isIfOfInterest (CIf cond _ _ _) = not (null (listify isFooIdent cond)) not isIfOfInterest (CIf cond _ _ _) = not (null (listify fooIdent cond))

You are correct. The nice thing is that this mistake would have been caught compile-time.

You mean, "identifier not found"... ?

Re: Why Haskell Is Worth Learning

#74
post #25

I have to admit that I'm really on the fence about Haskell. My major gripe with this point I think is point (3). Haskell has (IMHO) gone down a similar road to Scala. Scala has literally tied itself into knots to make statically typesafe collections (amongst other things). I see parallels with Haskell (maintaining functionality purity but dealing with the "outside world" through monads). I'm not saying this is wrong.…

you might prefer ocaml (i do) - it has a lot of the functional power of haskell, but is comfortably multi-paradigm, and in particular pushes neither purity nor laziness upon you. also, the ocaml community has been considerably revitalised in the last year or so, so now is a good time to get into it

Re: Why Haskell Is Worth Learning

#75
post #25

I have to admit that I'm really on the fence about Haskell. My major gripe with this point I think is point (3). Haskell has (IMHO) gone down a similar road to Scala. Scala has literally tied itself into knots to make statically typesafe collections (amongst other things). I see parallels with Haskell (maintaining functionality purity but dealing with the "outside world" through monads). I'm not saying this is wrong.…

Comparing Lisp to C isn't fair. Both are arguably difficult to master, but one took off because chip manufacturers decided to optimize for it.

Re: Why Haskell Is Worth Learning

#76
post #46

Earlier quoted context omitted.

It is an issue of the language's qualities if it does not really make it easier to reason about code. I find reason to question the simplicity of something which is widely acknowledged to take a lot of time to learn, to be mind-bending, and which seems to be impossible to explain simply - without deep theoretical background, academic citations or oversimplifications acknowledged as misleading. I think it would be mat…

>It is an issue of the language's qualities if it does not really make it easier to reason about code. The primary point of haskell is making it easier to reason about your code. >I find reason to question the simplicity of something which is widely acknowledged to take a lot of time to learn, to be mind-bending, and which seems to be impossible to explain simply It takes a long time to learn any programming language…

The tiobe index has lisp in the top 20 (at 13th) while Haskell is at 33rd, so lisp is more popular than Haskell even though lisp is over a half century old. Being in the top twenty after 50 years looks like the very definition of "survivor" to me.

Re: Why Haskell Is Worth Learning

#77
post #53

Earlier quoted context omitted.

You have to scroll back to see the actual error. That could be anything from missing C libraries to a permission problem.

I'm sure it's fixable, it's just not the best first impression for those new to the ecosystem :) I love trying out new languages (prag pubs 7 languages in 7 days is great) but for production work I want to know that down the line if I need lib x, it won't be hard to find and even more importantly it will just work (or the googles machine will lead me in the right direction). I actually stayed away from Scala for a wh…

I do not think ghc/haskell-platform targets homebrew, as most programs/libraries do not right?

So some amount of leg work is bound to come up if you install many packages through homebrew.

Re: Why Haskell Is Worth Learning

#78
post #38

Earlier quoted context omitted.

Learning Haskell taught me that mutation and state are good things, present both in the fundamental nature of computers and the real world. Haskell's attempts to eliminate state entirely results in a profound increase in complexity. For me, learning Haskell was like visiting a third-world country: enlightening, very different, but ultimately I leave feeling very grateful that I'm not a permanent resident. All in all,…

It doesn't sound like you actually did learn haskell. Haskell does not in any way make any attempt to eliminate state, and the idea that it does is absurd. Why would the language ship with a module called "State" if it were trying to eliminate state?

Substitute "treat like a pariah" for "eliminate" and you're good to go!

Re: Why Haskell Is Worth Learning

#79
post #74
post #25

I have to admit that I'm really on the fence about Haskell. My major gripe with this point I think is point (3). Haskell has (IMHO) gone down a similar road to Scala. Scala has literally tied itself into knots to make statically typesafe collections (amongst other things). I see parallels with Haskell (maintaining functionality purity but dealing with the "outside world" through monads). I'm not saying this is wrong.…

you might prefer ocaml (i do) - it has a lot of the functional power of haskell, but is comfortably multi-paradigm, and in particular pushes neither purity nor laziness upon you. also, the ocaml community has been considerably revitalised in the last year or so, so now is a good time to get into it

I understand F# is in the ocaml family. Any reason why one would prefer ocaml over fsharp?

Re: Why Haskell Is Worth Learning

#80

I love haskell but I wish there was less blogging about why everyone else should use it and more building things that will make people want to use it. The community is extraordinarily friendly to beginners, as long as you only count how they interact with beginners. If you count having resources that allow beginners to figure something out without having to ask then they are extraordinarily unfriendly. If I find a po…

I think generally the advice to beginners is to ignore most of Hackage and focus on the Haskell platform—which is frankly kind of terrible advice. It's intended to avoid things like the enumerator/iteratee/conduit/pipes madness and focus on a stable library interface, but almost all of the fun is being developed on the bleeding edge of Hackage.

I'd agree completely that this is a deficiency with the Haskell community, but I also don't see it stopping until there's a larger critical mass of new users—a chicken and egg problem, certainly.

Post reply on HN