External Publication
Visit Post

Config languages (and Dhall)

Haskell Community [Unofficial] April 26, 2026
Source

FPtje:

Perhaps a smaller change is to add typing to that Python script. I don’t see any type annotations, and quite a few nested dicts.

Throw some dataclasses at it, or even a pydantic for good parsing/encoding, and you’ll be in a much, much better position to communicate metadata format changes. It would really just be changing the types and running your favourite Python type checker until it stops complaining. The past couple of years have seen quite a large push for typing in Python. It’s there for the taking. The script doesn’t have to be sad.

Update on this: I put my money where my mouth is and made the MR: rel_eng: Give the ghcup yaml generation script some Python (and Nix) love (!15966) · Merge requests · Glasgow Haskell Compiler / GHC · GitLab

Specifically, the declared type of the Ghcup yaml schema can be found here:

GitLab

rel_eng: Give the ghcup yaml generation script some Python (and Nix) love...

Hi there! This is my first contribution since either a very long time, maybe even forever. I was sniped by

This is already quite an improvement, if I say so myself. Note that I did cap my time on this, and theviArch: dict[ViArch, dict[Distro, dict[VersionStr, DlInfo]]] part can be made nicer by making more classes (instead of dictionaries).

Edit: I decided to come back and fix that nested dict.

I realize that this entire script would be superfluous if indeed replaced by e.g. nickel. I did want to demonstrate the typing capabilities of modern Python, though.

Discussion in the ATmosphere

Loading comments...