error-message-index icon indicating copy to clipboard operation
error-message-index copied to clipboard

Should we keep the GHC error message as a separate file?

Open BinderDavid opened this issue 1 year ago • 2 comments

In the examples for each error message we currently have the following directory structure:

- before/module.hs
- after/module.hs
- index.md

and the index.md looks something like this:

---
title: Interesting description
---

Blablabla

Main.hs:4:1: error: [GHC-44432]
    The type signature for ‘foo’ lacks an accompanying binding
  |
4 | foo :: Int
  | ^^^

Should we maybe think about moving the error message into a separate file? Maybe like the following:

- before/module.hs
- after/module.hs
- index.md
- error.stderr

And then use Hakyll to insert the error message into the description? The main motivation is that it will be much more difficult to do anything with scripts which could regenerate or check the error output in the future. Opinions: @david-christiansen ?

BinderDavid avatar Jun 11 '23 17:06 BinderDavid

This sounds like a good idea, though tedious to implement.

david-christiansen avatar Jun 11 '23 18:06 david-christiansen

On further thoughts, the messages should typically be associated with the examples, rather than with the main text. But having a file for them, perhaps with metadata matching it to a GHC version range, would sure be nice.

david-christiansen avatar Aug 22 '23 14:08 david-christiansen