Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

Yes, Haskell is missing tutorials, how-tos, stuff that make those more complex concepts easier to understand.

As an example, the single kind off complex library I created (called "interruptible") is still lacking a good explanation of what it is good for, because despite having created it to solve a specific problem of mine, I still could not find a good way to explain it.



sort by: page size:

What about Haskell is too complex?

If you go through A Gentle Introduction to Haskell[0] I think you'll see it's a pretty simple language. There aren't that many parts of core Haskell to learn about.

Perhaps the abstractions such as Monad and Functor are more complex, but they don't seem anymore complex than some of the design patterns used to accomplish what they're used for.

0: http://www.haskell.org/tutorial/


+1.

I have in most years learned some nicher languages: Elm, Rescript, Racket, Common Lisp.

But nothing is even remotely bad as Haskell is.

Even just setting up an IDE to have basics like syntax highlight or go to definition is a giant chore.

On the official Haskell devcontainer offered by GitHub is nearly impossible to add any external dependency, so having a one-click shareable Haskell environment in the cloud (the very basic to onboard people on the language without wasting them days into having their own inconsistent environment) is a must.

Another thing that I feel sucks is the default documentation for Haskell libraries. Doesn't say anything useful at all, bundles few definitions here and there, 0 examples, and more often than not there's 0 documentation.


+1 everything you said.

Do you think it would be dramatically improved if Haskell had a bigger community of people contributing user-friendly libraries and tutorials? That was something that made Ruby the perfect newbie language for me. And something I feel is downplayed in Haskell given it's more advanced user base who is a little too obsessed with it's power and demonstrating their knowledge as such, rather than help make it accessible to others.

I can't count the amount of times I came across a popular Haskell library with very little documentation rather than it's type/function API and general blurb about what it does. This is very different that most popular JS/Ruby/Python/etc libraries which include quick-start/getting started/usage examples/etc etc.


I taught myself Haskell to an intermediate level a few years ago, and I think you're touching on the truth here.

Haskell is hard to learn, or at least it was for me. There is a whole laundry list of concepts I had never even heard of that I had to understand before I could do anything real with the language. Some were apparently dead simple yet frustratingly abstract (e.g. Monoids). Some were intuitive but still took time to grok (e.g. list manipulation stuff). Some twisted my brain into knots and only yielded to persistent study and practice (e.g. monads with threaded state).

As I was working through all these "basics", I was constantly frustrated trying to write simple programs. I don't recall whether I blamed it on a lack of beginner-friendly documentation or not, but slowly it all started to resolve into a coherent picture and once I could consistently read and understand real-world types I found that the available documentation was almost always enough for me to quickly understand an interface and how to proceed in using it.

I think both sides of this debate are partly right. Haskell's learning curve seems to keep going up as far as you want to climb, and some of the stuff at the intermediate level IMO could really use more examples and documentation, or at least that was my opinion when I was looking at it a year or so ago. One good example might be Template Haskell, which pissed me off to no end every time I tried to use it even in very simple applications. It involves a lot of new syntax and concepts and IIRC had literally no documentation besides what Haddock gives you for free.

On the other hand, I think a lot of people criticize Haskell's documentation without knowing the language well enough to make use of said docs or even understand how they might be useful. IMO it's unrealistic to expect every module and library to provide documentation specifically for beginners who don't understand challenging yet ubiquitous concepts (like state monads, to use your example), and I don't think other languages necessarily do a better job at this, but Haskell is just so darn tricky to get your head around that the "total beginner" phase lasts way longer than it might in e.g. Python.

For beginners who do want to learn about the core concepts of the language, I found that there was plenty of material to help me on my journey: Real World Haskell, LYAH, the IRC channel, and the internet full of blog posts, to name just a few. I don't mean for this comment to cause offense, or to belittle anyone. I'm certainly not an expert Haskell programmer, and there is much that I still don't understand about it. I just wanted to share some insights I've had learning it and using it in some practical applications.


That's why I was very precise in my statement.

    The great thing about Haskell is that for many purposes, you don't need to understand the math or have a tutorial to use a new library.
and

    But a complaint that you can't use most libraries because they involve math you don't understand and don't have any tutorials? That's one of the silliest things I've ever heard.
Note the word "library" in both of those. I was very precise. Library documentation isn't lacking the way some people complain loudly that it is.

I think, coming from other languages, it takes a while to really absorb how much you can rely on types to tell you what a function is doing - to the degree that for some functions you can infer the implementation from them[1].

That said, Haskell documentation tends to be really lacking on some of the basics that other ecosystems get right, like where to start, shielding beginners from functions for more niche usecases, examples of how to build or deconstruct values, or end-to-end case studies. Some of the nicest things to _use_ have an API that primarily comes from typeclasses in base, and don't provide any documentation beyond a list of typeclasses. My impression has been that most Haskellers seem to be on the same page that those things need work, though - I'm optimistic about the situation improving, but it's still hard to recommend to anyone expecting the experience of working with popular libraries from more mainstream ecosystems.

[1] https://bartoszmilewski.com/2014/09/22/parametricity-money-f...


Exactly!

Don't get me wrong, I don't think that most Haskell tutorials are inherently bad, I just couldn't find a good introduction to Haskell targeted at programmers which are already familiar with functional programming concepts.


I suspect the problem is mentoring. It took me months to get basic Haskell.

The people I mentored, though, could clarify any misunderstanding and get explanations from multiple viewpoints from me -- after years of experience with these abstractions. With such mentoring, you don't have to go through all the confusion phases.


Why can't Haskell tutorials speak plainly? I write code, I read mathematics. Each software concept has a linkage to a mathematical concept. I am not a magician to be gibbered at by strange words only understood by the esoteric initiates.

Part of the reason I stopped using haskell is because of how generalized everything is. I want to get something basic done and you are expected to read a whole book some maths topic to understand how do something basic. Another language would have an example on how to do that thing 99% of users are trying to do but in haskell land they want you to understand the 1000 different ways the library can be used and piece that together to work out what you want.

I am one of the people who are interested in Haskell and find its documentation lacking. I don’t miss comprehensive language books, I miss module documentation. It almost looks as the Haskell community has something against examples in documentation. I stress that the types are not enough. Contrast that with Elm, where I was able to write a working app in a day or so. But Elm is written off quite harshly in the post, so I am again left with the feeling that Haskell may not be the language meant for people like me.

From my own experience, Haskell is hard to learn. I have no grounding in maths, but that hasn't stopped me learning most languages. It's a pretty massive barrier to Haskell though, and I find that a lot of the community really struggle to explain things in terms that non-haskellers will understand.

The biggest problem I've found is a real inability to explain _why_ the things it does are cool, or what real-world applications they have.

I must admit that I also don't think it's a very pretty language. I like my code to be easy to read, and I just don't feel like Haskell fills that requirement. But that's obviously very subjective.

At the end of the day, I've found Rust more fun to learn and use, so I've been putting my time into that lately. Haskell is cool, but the time investment is high and the community is small, and I like to build things, rather than spend hours trying to figure out what a string of symbols mean.


Oh I agree that Haskell is complicated to learn, I just happen to think that that book kinda makes it even worse.

> you have datatypes and functions and that's it

For a "Hello World", maybe. Developing a non-trivial Haskell app or library will require the equivalent amount of knowledge (if not more) as developing a Java app or library.


This is my problem with everything I encounter when trying to learn about Haskell. I find almost everything I come across to be completely unapproachable. If I cant understand the problem you're solving in the blog post then the solution makes even less sense. I don't say this as a criticism of this author at all. It's just something I've noticed with Haskell.

I think that one of its biggest problems has been the vast majority of the "Teach Yourself Haskell" books/articles.

When I first had a go at learning it, I ran into two common problems with them. Firstly they usually did a great job of showing you how to write a quicksort or a Fibonacci sequence but then struggled to explain how it applied to most every day challenges (things like i/o - and yes, I sort of understand the complexity around that in Haskell, but as a developer, it's one of the key things I'm likely to want to do).

The other problem was that examples were typically full of what I would consider appallingly named/abbreviated functions,parameters etc

"fib' (f, g) p"

for example.

When you're already struggling to understand langauge concepts, having your code full of "f,g, and p" and trying to remember what they mean really doesn't help.

I think it's improving (Learn You a Haskell looks pretty good, but I've not had a serious attempt to re-learn since that appeared), but it's always been a bit of stumbling block for me in the past.


In my view, one of the largest problems Haskell has--much like Linux--is that it's hard to get started. There is quite a bit of incidental complexity: you have to install the compiler (or Haskell Platform), set up an editor, learn about cabal and so on.

Partly because of this, Haskell is never the "default" choice--if you set out to "learn programming", you'll be quickly herded to JavaScript, Java, Python or, god forbid, PHP. The only people learning Haskell are the ones who set out to learn Haskell.

Hopefully a nice web-based, turnkey development environment will really help with the upfront cost. Now to learn Haskell somebody just has to go to the website and start.

Of course, interactive tutorials for Haskell would make for an even nicer introduction. And hey, the same company behind this IDE has something like that: the School of Haskell[1]! It lets readers edit and run Haskell code snippets right in the browser, which should make picking up the basics even easier.

[1]: https://www.fpcomplete.com/school

It's very gratifying to see people chipping away at one of the main walls to Haskell adoption.


One of the points the author touches is documentation. I just couldn't get why then he gave advantage to Haskell, since the documentation of Haskell libraries famously consists of a few definitions of types. So, you know that there is an abstractly named monadic function, you know it takes a foo and returns monad foo. What more guidance would you ever need?

But when it comes to CL, he has expectations:

>I’ve opened an issue on GitHub of one quite popular library, asking the maintainer to write documentation, but after 6 months it’s still not written (strange, right?).


I mean that as a whole it's daunting and feels "unfriendly" to a lot of people. The heavy use of operators is part of it, but it's more than that. Haskell gets really abstract, which is cool, but it's hard to think about. Like I said, even monoids and monads seem hard to people learning Haskell despite being really simple. And look at the FAQ on that Lens library — it's an abstraction on top of things that are already pretty abstract in Haskell to offer "a vocabulary for composing them and working with their compositions along with specializations of these ideas to monomorphic 'containers'". That's cool and I really don't mean to criticize it, but it's undeniably esoteric and abstract.
next

Legal | privacy