[Nix-dev] Typing nix − funding campaign
Ludovic Courtès
ludo at gnu.org
Thu Mar 30 13:02:17 CEST 2017
Hello,
Théophane Hufschmitt <rg_nixos at regnat.ovh> skribis:
> Wed 29 Mar 17 − 17:25, Mateusz Kowalczyk(fuuzetsu at fuuzetsu.co.uk) a écrit:
>> I'm sure you've answered this ad nauseum before but I wonder how you're
>> going to type sets? They are bread-and-butter in nixpkgs. Presumably
>> they will be typed on their fields with the standard subtyping, like
>> anonymous records.
>
> I didn't talk about records, because they are a quite difficult topic,
> and I don't exactly know what their typing will look like in the end.
The problem is that attribute sets are often used like records, but they
are not records at all. Rather, they’re roughly hash tables where the
key is a string/symbol.
In Guix we use actual records where needed so that we can verify basic
properties at compilation time, such as field names. Record types are
disjoint from one another, which allows at least for run-time type
checking.
Ludo’.
More information about the nix-dev
mailing list