Haskell for All

haskellforall.com · Personal blog · on HN since 2012

Gabriel Gonzalez writes about Haskell, functional programming patterns, type classes, and practical tooling like shell scripting.

What HN saysCommenters praise Gabriel's work and link his posts, such as 'Scrap your type classes', though one says that idea never caught on because of poor ergonomics.
190HN people shared it
106linked it in comments
176stories submitted
4.0Kstory points
3 months agolast shared
2012people per year2026

Most-shared posts

  1. 1
    Scrap Your Type Classes
    14 people · 6 points · first shared 2012 · 1 comments on HN
  2. 2
    Program imperatively using Haskell lenses (2013)
    10 people · 62 points · first shared 2013 · 1 comments on HN
  3. 3
    You could have invented free monads
    10 people · first shared 2012
  4. 4
    Worst practices should be hard (2016)
    9 people · 80 points · first shared 2016 · 31 comments on HN
  5. 5
    The category design pattern
    8 people · 314 points · first shared 2012 · 156 comments on HN
  6. 6
    Use Haskell for shell scripting
    8 people · 219 points · first shared 2015 · 103 comments on HN
  7. 7
    Homepage
    8 people · first shared 2012
  8. 8
    A sufficiently detailed spec is code
    7 people · 6 points · first shared 2026 · discussion on HN
  9. 9
    Comonads Are Objects
    7 people · 6 points · first shared 2013 · discussion on HN
  10. 10
    Equational reasoning
    6 people · 82 points · first shared 2013 · 13 comments on HN
  11. 11
  12. 12
  13. 13
    Browse Code by Meaning
    5 people · 4 points · first shared 2026 · discussion on HN
  14. 14
    How to make your haskell code more
    5 people · first shared 2016
  15. 15
    Scalable Program Architectures
    4 people · 135 points · first shared 2014 · 79 comments on HN

What HN people wrote when they linked it

arianvanp · 2017-09-17
Gabriel also has a great blog http://www.haskellforall.com/ Basically the kind of person I would love to buy a beer any time because he does so much great work. on topic: The binary caches are great. For work I'm currently evaluating https://github.com/typeable/stackage2nix and https://github.com/input-output-hk/stack2nix to generate nix expressions from our haskell stack projects. And then push the build artifacts to a shared cache. Such that nobody has to ever compile a dependency twice. Because nothing sucks more than starting your day watching the compiler churn away at compiling after version bumps, to then also see a collegue go to the same pain all over again.
ixmatus · 2014-05-27
Someone told me this: with Haskell you end up reading a lot more up-front than you do "playing around" up-front. The reason for this is the type system which can feel like a straight jacket at first unless you understand it well. Don't read the monad tutorials. At all. Get a feel for the language with http://learnyouahaskell.com/chapters (you don't need to read the whole thing through, but probably should). Once you've played with the basics then you should absolutely read the http://www.haskell.org/haskellwiki/Typeclassopedia which gives you a very thoroughly walking through of the Type System and is essential but heavy reading to be at all productive with Haskell. After that make sure you are using Hoogle to search for functions that already exist!!! http://www.haskell.org/hoogle/ One strategy no one really told me about: search for functions based on their type and less their "name". Then after that, Gabriel Gonzalez writes some really great noob-intermediate friendly tutorials on Haskell in-general: http://www.haskellforall.com/ (don't start with his stuff though as you should have familiarity with Haskell basics first!!). Once you're proficient, having Hoogle built into your command-line, using CTAGS + codex, Lambdabot + Emacs, and GHC-mod + emacs is pretty crucial to my workflow. Hoogle in the commandline is really powerful, CTAGS + codex is basically CTAGS for haskell source files (if you don't know what ctags are look it up), and lambdabot is a powerful tool…
yuye · 2026-08-19
Someone shared this great read with me that also agrees with this point of view: https://haskellforall.com/2026/03/a-sufficiently-detailed-spec-is-code
foldr · 2026-08-02
Like this, you mean? https://haskellforall.com/2012/05/scrap-your-type-classes Fine in principle, but AFAIK it never really caught on because the ergonomics suck. Interfaces/traits/type classes do seem to be a popular feature across languages, for what it's worth.
tiffanyh · 2026-02-17
I really like @mitchellh perspective on this topic of moving off GitHub. > If you're a code forge competing with GitHub and you look anything like GitHub then you've already lost. GitHub was the best solution for 2010. https://x.com/mitchellh/status/2023502586440282256#m > Using GitHub as an example but all forges are similar so not singling them out here This page is mostly useless. https://x.com/mitchellh/status/2023499685764456455#m > The default source view ... should be something like this: https://haskellforall.com/2026/02/browse-code-by-meaning https://x.com/mitchellh/status/2023497187288907916#m
throwaway81523 · 2024-12-02
Sure, Haskell's type system (and type systems in general) are informed by categories: https://en.wikibooks.org/wiki/Haskell/Category_theory This article is also nice: https://www.haskellforall.com/2012/08/the-category-design-pattern.html It explins how Haskell's monad laws follow directly from how categories work.
dongcarl · 2023-09-30
It's mostly bash scripts (I know I have stockholm syndrome there) and nixos-rebuild: https://www.haskellforall.com/2023/01/announcing-nixos-rebuild-new-dep… All the nix deployment tools had too much magic and broke, but nixos-rebuild always works and it's part of Nix! Disko was great for bootstrapping servers: https://github.com/nix-community/disko
lgas · 2020-01-25
That's not a particularly great example though because 99 bottles of beer is not a particularly stateful computation. You could easily do it without state at all like this: https://gist.github.com/lgastako/2e7dfd6b1118bb408ff114a4be46eac9 On the other hand this blog post http://www.haskellforall.com/2013/05/program-imperatively-using-haskel… demonstrates how one of the bits of Haskell that some people find complex (lenses) can be used together with the state monad to provide an "imperative-like" experience that's even nicer than most imperative languages.
olah_1 · 2019-10-17
>but what's wrong with the syntax? I'll just link to this blog about readable Haskell. If everyone followed his advise, it would be much better. http://www.haskellforall.com/2015/09/how-to-make-your-haskell-code-mor…
xelxebar · 2019-05-17
Along these lines is an intermediate language called Morte[0], developed by Gabriel Gonzalez, well known in the Haskell community. It seems to still be getting some love. The basic idea is to implement a strongly normalizing calculus of constructions which languages can compile down to. That way, equivalent functions provably generate equivalent code. Here's [1] a blog from 2014 that goes into more detail on motivation, examples, and the like. There's a proof-of-concept frontend called Annah[2]. I'm unaware of any backends though. [0]:https://github.com/Gabriel439/Haskell-Morte-Library [1]:http://www.haskellforall.com/2014/09/morte-intermediate-language-for-s… [2]:https://github.com/Gabriel439/Haskell-Annah-Library
sideeffffect · 2019-04-13
It's a bit sad, that Dhall (programmable configuration language for YAML & co.) used to use IPFS for its source/packages, but stopped, because of reliability :( (I'm wondering if there are/were others?) > Early on in the language history we used IPFS to distribute the Dhall Prelude, but due to reliability issues we’ve switched to using GitHub for hosting Dhall code. http://www.haskellforall.com/2019/01/dhall-year-in-review-2018-2019.ht… https://github.com/dhall-lang/dhall-lang/issues/162 I wish IPFS the best, because at least in theory this seems like a perfect use case
equalunique · 2019-02-08
Maybe we should be exploring using Dhall instead of YAML. >One of the clearest signals I’ve gotten from users is that Dhall is “the YAML killer”, for the following reasons: >Dhall solves many of the problems that pervade enterprise YAML configuration, including excessive repetition and templating errors >Dhall still provides many of the good parts of YAML, such as multi-line strings and comments, except with a sane standard >Dhall can be converted to YAML using a tiny statically linked executable, which provides a smooth migration path for “brownfield” deployment. Source: http://www.haskellforall.com/2019/01/dhall-year-in-review-2018-2019.ht…
sridca · 2018-08-22
I agree re: marketing -- something I had easily fell for. One of the authors has moved onto writing another Haskell book (a "work of art" apparently), but this time my interest, for an intermediate level book, is elsewhere: https://intermediatehaskell.com/ (which would be more informative--thus pedagogically sound--than a work of art). Lesson learned: don't fall for the marketing of art. Generally the best way to learn is by actually doing projects: http://www.haskellforall.com/2017/10/advice-for-haskell-beginners.html
marcosdumay · 2018-05-02
> Rust will likely infringe on Python over time due to performance, lower defect rate, long-term maintenance advantages No love for Haskell[0]? It does look like the best system scripting language out there right now... I have just never tried it to be sure :( 0: http://www.haskellforall.com/2015/01/use-haskell-for-shell-scripting.h…
mazelife · 2017-09-13
There's a good blog post as a kind of follow-up to this one that talks about how thinking in terms of monoids helps enable flat architectures and composability in Haskell: http://www.haskellforall.com/2014/04/scalable-program-architectures.ht…
kccqzy · 2017-05-03
This reminds me of Morte, an experimental mid-level functional language created by Gabriel Gonzalez. They both seem to be super-optimizing, that is partially executing the program in question. Of course it is a great deal easier to do in a functional language than JavaScript. http://www.haskellforall.com/2014/09/morte-intermediate-language-for-s…
lmm · 2016-06-27
> Things needing call-back functions need to support an extra void* of course, and sadly it is often left out. Well when doing the right thing means writing more verbose code, it's no surprise that people do the quick-and-dirty thing (see http://www.haskellforall.com/2016/04/worst-practices-should-be-hard.ht… ). Since "everyone knows" that best practice for a callback is to take a function pointer and a void * , wouldn't it be better to have that idiom built into the language? (i.e. a concise syntax for the pair of callback-and-void * , and a concise syntax for "invoking" the pair, passing the extra void * along with the "ordinary" arguments).
virtualwhys · 2015-11-28
As powerful as Persistent with Esqueleto? Slick, Squeryl, Quill, sqlTyped, probably others. Scala's type safe query dsl story is exceptionally good (I'd go so far as to say unrivaled, but working in Scala I'm biased). Don't forget JDBC, Haskell is in the stone ages on this front. Like the JVM so much engineering has gone into JDBC, and all major database vendors have drivers for it. Not the case for Haskell, and even if it were, Esqueleto offically supports a single database, Postgres. Haskellers in the know are well aware of deficiencies in this area[1]. Perhaps down the road things will change, but for now I couldn't help but rofl at the question ;-) [1] http://www.haskellforall.com/#databases-and-data-stores
joeyh · 2015-10-18
I remember reading about this earlier here: http://www.haskellforall.com/2014/09/morte-intermediate-language-for-s… http://www.haskellforall.com/2015/05/the-internet-of-code.html This is just one piece of the puzzle in a long-term project of mine to build a typed and distributed intermediate language that we can use to share code across language boundaries. I want to give people the freedom to program in the language of their choice while still interoperating freely with other languages. Super interesting ideas, great that it's progressing beyond that initial sketch.
coolsunglasses · 2015-09-13
This is my favorite post on desugaring Haskell syntax: http://www.haskellforall.com/2014/10/how-to-desugar-haskell-code.html
mlitchard · 2015-04-06
In no particular order Dan Piponi http://blog.sigfpe.com/ The ever awesome oleg http://okmij.org/ftp/ Chris Done http://chrisdone.com/ Gabriel Gonzalez http://www.haskellforall.com/ There are many more. The haskell community has awesome developers in abundance.
tomwilde · 2014-11-28
Why do Haskell programmers see it as a good thing to package their abstractions in syntactic sugar? Stop doing that. It makes it incredibly difficult to participate -- you basically need to learn 3 syntaxes on top of Haskell's own to contribute to any non-trivial project. I'm referring to the article the post's author recommends: http://www.haskellforall.com/2013/02/you-could-have-invented-comonads.…
comex · 2014-07-12
The standard counter-argument is that by enforcing purity, Haskell improves encapsulation and the ability to reason about the program (see paeans about equational reasoning [1]), and prevents all the myriad classes of bugs associated with mutable state - thus greatly improving productivity. (The same applies to its more precise type system in general.) I'm not sure how much I believe it, but some people swear by it... [1] http://www.haskellforall.com/2013/12/equational-reasoning.html
quchen · 2014-04-14
Gabriel is also the author of the popular Pipes Haskell library, and nice person in general. Both of these make me heartily recommend his other blog posts about various Haskell topics, which often portray advanced features remarkably well. Examples: Scrap your type classes: http://www.haskellforall.com/2012/05/scrap-your-type-classes.html Hello Core: http://www.haskellforall.com/2012/10/hello-core.html Coding a simple concurrent scheduler yourself: http://www.haskellforall.com/2013/06/from-zero-to-cooperative-threads-… Tutorial as part of library doc (!): http://hackage.haskell.org/package/pipes-4.1.1/docs/Pipes-Tutorial.htm…
alipang · 2013-07-22
Another great writeup on lenses I highly recommend, http://www.haskellforall.com/2013/05/program-imperatively-using-haskel…
internet_points · 2026-05-21
There are lots of people successfully using agents with Haskell, for example * https://github.com/digitallyinduced/ihp/ is mainly written with Claude now * https://jappie.me/haskell-vibes.html is gushing over agent-written Haskell * https://discourse.haskell.org/t/anti-llm-sentiment-considered-harmful/… huge thread about the divisiveness of LLM's from some person who loves using them with Haskell I can see how agent coding is a nice fit for Haskell, since LLM's tend to be best at tasks where you can easily verify the output – and GHC lets you easily verify much more of your domain than say Python (sure you can test some of what dynamic typing doesn't catch, but LLM-written tests do not always do what you think they should[0]). At the same time, the LLMs tend to not code golf unless asked to, and they don't care if they have to wait for dependencies to compile, so that takes away the two major Haskell time sinks. [0] https://haskellforall.com/2026/05/type-out-the-code#:~:text=scrutinize…
thesz · 2026-04-06
It is hard to find market shares of Viaweb and Yahoo at the time of Viaweb's purchase, the best I've found is that Viaweb was bought for 1/4 of Yahoo's net revenue at the time ($49M price/$203 net revenue in 1998). Viaweb was not profitable at the time of purchase, but it had about four people and quite modest hardware costs. While there are no companies with $1.5 trillions (4*$380B) of net revenue, the difference is that Anthropic is cash net-negative, has more than 4 people in staff (none of them are hungry artists like PG) and hardware use spendings, I think, are astronomical. They are cash net-negative because of hardware needed to train models. There should be more than one company able to offer good purchase terms to Anthropic's owners. I also think that Anthropic, just like OpenAI and most of other LLM companies and companies' departments, ride "test set leakage," hoping general public and investors do not understand. Their models do not generalize well, being unable to generate working code in Haskell [1] at the very least. [1] https://haskellforall.com/2026/03/a-sufficiently-detailed-spec-is-code PG's Viaweb had an awful code as a liability. Anthropic's Claude Code has an awful implementation (code) and produces awful code, with more liability than code written by human.
dematz · 2026-03-22
Idk, while system architecture diagrams look cool and feel informative, I generally don't feel like they actually help you get started working somewhere on a project. Mistake #3 in this article, putting too much in, is part of this. So https://www.jerf.org/iri/post/2025/on_layers_and_boxes_and_lines/#diag… is an interesting take: put links in your diagram, so it functions as a table of contents. This seems most useful for someone who needs to start working on a project. Similarly https://haskellforall.com/2026/02/browse-code-by-meaning asks how to show what's in a repo, but maybe file tree is not best and a diagram with links as table of contents is the answer. That said practically speaking, I'm not sure what tooling easily creates working links in a diagram that looks good in any context, for instance mermaid might render on github but not a text editor. Of course for other purposes maybe just go crazy with the diagram. I once had a coworker draw this super detailed master diagram, maybe 50-100 things on it, which I was told impressed senior government officials (after my manager recolored all the red to avoid connoting errors). But for the purpose of orienting developers a table of contents with links sounds better.
mwattsun · 2022-01-03
Thank you for the examples. I'm really curious to get to the bottom of this. My inspiration has been Erik Meijer, specifically his article "Confessions of a Used Programming Language Salesman. Getting the Masses Hooked on Haskell" [1]. If I understand you correctly, you are implementing lazy evaluation in your when macro, something you call short-circuiting. By dropping laziness in strict functional languages such as Scheme, SML, OCaml, Scala, and F#, the purity and semantic beauty of true functional programming is lost. When programming in Haskell, laziness is one of those things that you rely on all the time without noticing it; it is something you only realize once you miss it. As for async/await, Erik led the effort to put it in C# and then Dart. I'm assuming he wanted to bring Haskell Continuation Monads [2] to the popular languages. I'm building a hobby website, so I got into Blazor because I like C# and was interested in doing it client side. I gave up on it, not because of C# or bad implementation (it's actually great) but because Microsoft has a noisy and bureaucratic way of configuring code that drives me nuts. I went back to Dart because it is amazingly productive on the client side, but now this video [3] shared in this thread makes me think I should give ClojureScript a try. [1] http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.72.868&re… [2] https://www.haskellforall.com/2012/12/the-continuation-monad.html [3]…
Twisol · 2021-09-10
I agree with your overall point, but I want to dig in on this bit: > Not all functional languages have typeclasses or an alternative and convenient way to express these concepts, and in those, it's not so important to understand these notions abstractly. This is true only in an especially strict sense. Haskell's typeclasses provide two basic mechanisms: one for associating a dictionary of data with a type, and one for automatically picking / deducing such a dictionary based on a given type. Only the latter is specific to Haskell (and Scala); the first can be performed even in Java, but you have to explicitly pass the desired dictionary (called a "trait") at all call sites. [0] I legitimately use traits all the time in Java, and it even has some built-in ones, like Comparator. There's a great paper on the same fundamental technique at [1] (there called "object algebras"). [0] https://www.haskellforall.com/2012/05/scrap-your-type-classes.html [1] https://www.cs.utexas.edu/~wcook/Drafts/2012/ecoop2012.pdf

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close