How to grow the (commercial) Haskell user base?

I’ve worked with Mu. It’s not that bad. The recursive combinators are implemented in C++.

They’re also trying to make it compileable with GHC: Compiling Mu with GHC: Halfway Down the Rabbit Hole (HIW 2022) - ICFP 2022

Maintaining your own compiler is a lot of work.

In a way, it does speak for the success of Haskell. Any derivate does.

4 Likes

I guess this is an important distinction to make: are we talking about “growing the use of Haskell” as in “the use of GHC and its tooling” or as in “growing the users of Haskell’s (main) idea”, which means users of a pure functional language with a type system “similar to Haskell’s” - for various degrees of “similar” ranging from Elm to Idris 2. I’d say the “idea” is more important than the implementation.

Just curious, besides the following list of key Haskell libraries:

vector
text
bytestring
containers
unordered-containers
aeson

(List any I’ve missed, but try to keep the list short), and the following list of “do things” libraries:

brick
monomer
twain / Servant - servant-server
postgresql-simple / hasql
lucid / blaze

What other libraries are needed for a potential “you’ve been on-boarded onto Haskell, but not the specific dialect in use at your workplace” book?

If Mercury reports they need 5 weeks for minimal proficiency, how do we get it so it turns into 2 weeks to make sure newbies understand the basics and the rest is codebase-specific Haskell?

You need to stop thinking in terms of a book and start thinking in terms of

People read books when they have decided to invest time reading them - in which case paying for a book is usually no problem. What’s needed is something to take people from “I’m mildly curious about Haskell” to “I am going to learn Haskell.”

Also: a lot of text in the wikibook is useless or worse. Eg this gem

Of course, you can use functions that you have already defined to define new functions, just like you can use the predefined functions like addition (+) or multiplication (*) (operators are defined as functions in Haskell). For example, to calculate the area of a square, we can reuse our function that calculates the area of a rectangle:

This is so shallow and pointless that the average reader’s brain may well reject it and they will waste time rereading and looking for a deeper meaning. (That’s what mine just did.) Programmers expect functions to be able to call functions, they don’t need telling that they can, gosh, call the factorial function they’ve just written. You just need

This is how you define and call a function in Haskell:

product a b = a * b
product 2 * 7 => 14

This is called currying:

m42 = product 42
m42 10 => 420
m42 2 => 84

This is “point free” style

m7 = (*7)
m7 3 => 21

Haskell is an expression based language, ie a function is a chain of value calculations leading to a final value that gets returned. That means every step must have a value. Eg both branches of an if statement “return” a value:

factorial x = if x==1 then 1 else factorial x * factorial (x-1)

You may use less if’s than you expect in Haskell thanks to alternatives like pattern matching on values

factorial 1 = 1
factorial x = x * factorial (x-1)

and guards:

…Obvious example omitted. Then show :t and writing a type signature:

This is a type signature. Haskell can generate them for you, but you will often want the control of writing them yourself:

product Num a => a → a → a
mul42 Num a=> a → a

Num a => constrains the arguments to belong to things that implement operations like + and *
a → a → a means takes a Num, then another Num, then returns a Num.

Then you move on to tuples and lists, which is when you also bring in where, passing functions around, and more pattern matching. That fast.

The point is to get people interested. And the way to get programmers interested - especially the ones willing to try a new language - is to show them cool code as quickly as possible. Again, as quickly as possible. Not to bore them to death telling them that functions can call functions. It’s coding language speed dating. The goal should be to intrigue the other person, not to tell them your life history in minute detail.

3 Likes

So… too long, then ?

I agree the presentation and efficiency of Go by Example is lovely. Thanks for the link.

2 Likes

Too long and too - this isn’t good writing. If you really must discuss it, say “functions can call functions” - ideally followed by a short example. Not

Because Politics and the English Language | The Orwell Foundation

There is a lot of valuable material in the wikibook, but it could use an edit. (I did submit some.)

Eg its prone to “You may think that the next topic is very difficult but it’s not that bad!!!” Which leaves the reader thinking that Topic X, which they previously had no opinion of or expectations regarding is, indeed, a PITA. Just don’t do this in instructional writing ever.

And from a discussion on monads (of course) is “The key here is that no computation is done.” Without defining what computation means to the writer. What they really mean is that a Monad doesn’t turn a 4 into an 8 or a “cat”. It passes on values (or sometimes withholds them and bypasses a function, it doesn’t mutate them.

Technical writing really should be part of Comp Sci degree courses. Although I suspect a lot of faculties lack anyone fit to teach it.

1 Like

Magical Haskell is 80% of the way there, or 20% of the way there depending on how you look at it. Absurdist vignettes motivate examples and problems, early coverage of type theory helps with getting to true “thinking like a Haskeller”, except the current iteration is badly edited (what monoids are compared to is not fit for discussion in a professional forum) and has factual mistakes (we only wish Haskell had true pi and sigma types).

As always, Rust does a lot right; start by introducing tooling, get a demo program out, then go into theory and explanations.

But honestly, the only thing that’s really missing in the ecosystem right now is guides and tutorials for the libraries covering the big 4, TUI, GUI, backend, frontend. Everything else is well-handled, and most of the libraries can be covered with a chapter each.

====

Also, to this end, two books already exist:

First is the copy-paste Haskell you were asking about, second is “I just got a job at Mercury as a JSer, now what?”

But the thing is that the language designers reached this conclusion in foresight. There is a large body of work on designing programs in “Simple Haskell”, specifically

However, it looks like newcomers read other material first — What I am I supposed to do about that?

I can point to existing material or write it myself, e.g. about lazy evaluation, but I can’t forbid newcomers from reading “bad ideas” online or take YouTube away from them — and I probably shouldn’t.

3 Likes

I get the impression that the Haskell community hasn’t caught up with changes in the outside world. Functional programming is now reasonably mainstream:

Clojure, Scala, Elixir, and Kotlin - even Python - all provide decent support for functional programming and a good number of people do code that way at least part of the time. The problem isn’t convincing people to try fp, it’s convincing people interested in fp to try Haskell. To which my first answer would be that Haskell allows you to use type checking to provide a rock solid separation between the imperative shell and functional core - that’s something that makes experienced programmers, the people with influence in their organisations, interested.

3 Likes

When I started learning Rust, I was promptly pointed to the Rust book. Clearly, this is the perfect resource for people already knowledgeable about programming, that want to get started with Rust. Beyond the programming language, it also explains how to install the toolchain and set up a simple project.

I’ve been wondering if a resource like that would be useful for the Haskell community. Something that allows someone curious to get started quickly, with a low barrier for entry (i.e. no cost). If you like what you see, then you might consider investing money and time into more thorough learning resources.

In the Rust book, there are also chapters dedicated to Rust’s strengths in the space of system programming langauges. A Haskell equivalent definitely should emphasize some of the highlights, including laziness. (sidenote: laziness is awesome; we don’t celebrate it enough.)


This would be an ambitious project. I think the HF technical proposal process might be a good place to discuss more concretely what would go in such a resource. After all, there must be quite a bit of buy-in for something to go on the front page of haskell.org.

Moreover, there’s always the possibility for funding to come out of such a proposal, provided that people are really excited about the content. Anything that helps people get started with Haskell has the potential for a great return on investment.

I don’t think I would have the time to spearhead something like this alone over the next year or so, but I’m happy to assist in writing proposals (and chapters). Don’t hesitate to reach out.

3 Likes

The point to be made is that there is a TON of Haskell books out here right now. In 2010, there might have been only very few Haskell books, mostly oriented at academics, and in 2020, there was mainly HaskellBook, but now it’s 2025 and we have a glut of fairly decent Haskell books. Perhaps it’s a good time for The Haskell Programming Language 2027 or 2028?

The problem remains that to buy a book requires some level of commitment, and some financial means. I think there is value in providing something like the Rust book for free

I’m not suggesting to replace resources, but to encourage people to consume them by bridging the gap!

3 Likes

I really don’t think Haskell needs that. There are already several excellent books - I ordered Hutton and Skinner’s books the other day and they seem outstanding. The problem Haskell has is earlier in the adoption process, the time when you need to turn mild curiosity into deeper interest. Again, Golang By Example does this perfectly. It’s fast to read and its easy to pick up again if you break away because lunch is over. Golang also gets over its USP with GBE - “This language is Junior Programmer Proof.” Which is something Haskell should do too, and I’d suggest “The language of imperative shell, functional core.” Because that is, as they say, so hot right now. But “safe and expressive” might work too. Etc.

If people here wanted to produce a GBE style tutorial, it should be easy enough. We’d just have to agree a structure - I suggested one but people with more knowledge may disagree - volunteers would each write a chapter, and then, ideally, someone else would do a technical review and a third person edit the text down if needed - you need terse. I’d be willing to write a couple of the earlier chapters and edit down prose.

Once the community had the tutorial, it could be hosted on the web and made available as a free Kindle book, pdf, etc. Then people could link to it, post about it, etc.

Also, the tutorial does need to counter all those Haskell memes out there - ie the idea that Haskell isn’t used, that IO is a Phd topic, that it’s a language only for mathematicians and super programmers. (Although I wouldn’t go too far regarding the last point: it isn’t a language for every programmer, but if you’re smart enough to write a binary tree in C or Clojure, you can Haskell.)

2 Likes

Yes! And judging from the couple I just bought, the quality is excellent. Haskell doesn’t need another book: it needs something that’s more like an online pamphlet - again, like Go By Example. “Here’s some very basic code that shows cool things, thanks for paying attention for an hour. Now if you’re interested, buy X or Y.”

3 Likes

That’s what the Rust book is intended for, and I think it achieves its goal. In any case, we agree on the need, if not on the format and presentation.

I think clojure(script) is a good example which may Haskell community can look up.

clojure(script) benefits from syntax of lisp while it keeps it’s interpolate with other ecosystem like “JVM” “Javascript”. To grow the footprint of clojure/script ,user can build one in the current existing Java/TS project, without changing current codebase, just make it as addon, attach to current project. That would make growing of clojure less painless.

I think , to grow the user base of haskell , there should be more glue solution in Haskell, make it more easy to interact with other programming language, other than writing FFI manually.

Even thrift protobuf is not that easy way to make haskell interacting with Java and C world.

According to the publisher, the Rust book is 560 pages… So, no, it’s for people who aren’t committed to a language enough yet to read a book. It is a book! And Haskell already has several equivalents.

I don’t think the length matters too much. By chapter 6, you’ve had a tour of all the features the systems programmer might not be familiar with (borrow-checker and pattern matching).

Let me be more specific: the Rust book is a great introductory resource because:

2 Likes

This is out of date, I have no clue how to get ghcide working, but it’s a good prototype of what you’re looking for.

Tbh I don’t think the time is right for a Haskell equivalent to the Rust Book, a lot of different approaches are being tried, some more successful than others, but we don’t have anything canonically strong yet, with perhaps Rebecca Skinner’s Effective Haskell coming closest.

Still, Rust Book itself was just an online pamphlet for a while, before eventually being published.

3 Likes