Haskell Report 2024?

Does the following have any legs as an idea? If it is misconceived, please say so!

The Haskell Report 2010 is (a) authoritative (b) all in one place and (c) acts as a ‘landmark’ (something that other things are described by reference to).

The GHC language edition GHC2024 appears to be (a) the result of community input (what should be included and excluded was debated) and (b) relatively mature (in that it built on the prior experience of creating GHC2021). It also acts as a sort of landmark. The GHC User’s Guide says it is recommend for new code.

For each of the language extensions that are in GHC2024, there is good documentation - e.g. in the debated and adopted proposals that led to the extension, in the latest GHC User’s Guide itself etc., in other documents included in the User’s Guide ‘by reference’ - but not necessarily ‘all in one place’.

‘All in one place’ may be valued: some people interested in Haskell say they look wistfully at The Rust Programming Language book, for example.

Some AI tools seem reasonably good at tasks that involve taking information in one form and recasting it into another form (including following the style/tone of something that already exists) - at least, they seem to get part of the way there before a knowledgable person steps in to finish the job.

Could AI tools be used to help create the better part of a ‘Haskell Report 2024’, which would be (essentially) Haskell Report 2010 plus additional extensions in GHC2024, recasting the style/tone/form/scope so that the end product is consistent with the earlier report?

The intent being not to set anything in stone but to create a new landmark that is (a) authoritative and (b) all in one place.

I can imagine a process:

  1. For each extension, asking does it have a natural ‘home’ in the 2010 report structure, or does it need something ‘brand new’? You could ask AI that, and then ask the community to critique its suggestions.

  2. Once the ‘structural’ questions are settled, for each extension, you could ask AI to recast existing documentation into something consistent with the style/tone/conventions etc of the 2010 report. There would then be an open (and human) process to get from that output to something that met the desired quality theshold of the community. (The Haskell 2010 Report providing an example of quality.)

I am assuming that:

(a) this would involve only ‘recasting’ of what already exists in a well-defined way, not ‘origination’ (and so avoiding the sorts of debates that origination brings);

(b) the parts of the community interested in language design (at least, for the most part) does not look at any GHC2024 language extension and say “No, no, no! That has no place in a point of reference for modern Haskell!”; and

(c) AI tools can take out most of the ‘chore’ (unattractive to volunteers) leaving activities that are interesting to volunteers.

  1. Mentioning AI/LLMs may trigger an endless debate.
  2. I don’t think a new language report should just adopt a set of extensions.
  3. Other implementations, like MicroHs, may not agree with GHC2024.
  4. I’m not sure the community currently has enough resources for this.

On your point 2. “A new language report should not just adopt a set of extensions”, may I ask what you consider it should seek to do in addition to that?

(Something I had in mind myself was perhaps resolving at least some of the points where GHC’s Haskell2010 and the Haskell 2010 Report differ - Section 16.1 of the GHC User’s Guide. For each difference, it is possible to ask “Which is better: what GHC in fact does or what the Haskell 2010 Report provides?” In some cases, the answer to that question may be ‘clear cut’.)

Haha, you have scooped me by about 1 week :slight_smile: I am about to announce a project which will hopefully lead to a new Haskell report pretty soon, you just have to wait a few more days.

I think trying to bring GHC 2021 or GHC 2024 into report form is way too hard to consider as a single step. The user documentation in the GHC user guide and the GHC proposals is nowhere near precise enough to serve as language specification. One of the reasons the current Haskell 2010 language report can be somewhat concise is that it “cheats” by handwaving a lot of technical details and by referring to “standard techniques from Hindley-Milner type inference”. If we want the language report to cover features such as GADTs, type families etc. then we can no longer rely on this shortcut and have to rewrite large amounts of the report from scratch and explain all the technical details. The result would probably look much more like the papers Practical type inference for arbitrary-rank types or OutsideIn(X): Modular type inference with local assumptions - Simon Peyton Jones than the current report.

(Something I had in mind myself was perhaps resolving at least some of the points where GHC’s Haskell2010 and the Haskell 2010 Report differ - Section 16.1 of the GHC User’s Guide. For each difference, it is possible to ask “Which is better: what GHC in fact does or what the Haskell 2010 Report provides?” In some cases, the answer to that question may be ‘clear cut’.)

That is more or less precisely what I plan to do: A revised version of the Haskell 2010 language report that takes account of how the language has changed in the intervening years is a feasible project that can be achieved in a limited amount of time. GHC currently can’t compile any non-trivial Haskell 2010 programs, which is really a quite unfortunate situation. I think we can try to fix this problem first.

a) i’m not so sure all the extensions in GHC2024 are engineered or specified to the standard i’d expect for a Language Standard.

b) i’m absolutely certain there’s extensions in GHC2024 I would never switch on, and I regard as a code smell.

c) I wouldn’t trust an LLM to adequately document the caveats that Haskellers should beware of with some of those extensions.

d) GHC2024 doesn’t include several extensions I use regularly (and indeed without which GHC2024 alone doesn’t amount to a coherent language).

For example, we may want to revisit the standard library.