!djTaTBQyWEPRQxrPTb:nixos.org

Nixpkgs Architecture Team

230 Members
https://github.com/nixpkgs-architecture, weekly public meetings on Wednesday 15:00-16:00 UTC at https://meet.jit.si/nixpkgs-architecture51 Servers

Load older messages


SenderMessageTime
11 Jul 2023
@profpatsch:augsburg.oneprofpatschwhich gives yants the (partial) ability to type-check functions16:12:37
@profpatsch:augsburg.oneprofpatschtypes-simple can only typecheck “data”, not functions16:14:19
@profpatsch:augsburg.oneprofpatschdepends on what you want to do, for checkMeta only checking data should be enough16:14:47
@piegames:matrix.org@piegames:matrix.orgWell ideally I'd like to use this for Nixpkgs configuration too, but merging :(16:16:05
@profpatsch:augsburg.oneprofpatschmerging is different from typechecking16:16:53
@profpatsch:augsburg.oneprofpatschconflating the two is a big source of annoyance16:17:02
@piegames:matrix.org@piegames:matrix.orgI know16:17:13
@piegames:matrix.org@piegames:matrix.org One thing that I'd really like to have is some type checking but with default values support. Because currently, there's only the module system which can do that, and instantiating a module system just for each package's meta is not something that is going to fly 17:03:53
@profpatsch:augsburg.oneprofpatschpiegames: I haven’t thought in-depth about that, but to me a merging algorithm is just a monoidal thingy17:15:27
@profpatsch:augsburg.oneprofpatsch you can do a lot of things with that 17:15:47
@profpatsch:augsburg.oneprofpatsche.g. (//) and attributes form a monoid17:16:14
@profpatsch:augsburg.oneprofpatschSo does recursiveMerge and attrsets17:16:29
@profpatsch:augsburg.oneprofpatschs/attributes/attrsets/17:16:35
@profpatsch:augsburg.oneprofpatschI bet you can fit defaults and mkForce etc in there, too17:17:03
@piegames:matrix.org@piegames:matrix.org Actually merging itself, and having that in the type system isn't that big of a deal IMO. Problems arise if you expect to merge values with inter-dependencies. Like, Nixpkgs config requires merging as there are multiple places where the configuration can be but, but they are all independent from each other so it's a lot simpler 17:18:26
@profpatsch:augsburg.oneprofpatschpriority is pretty simple to fit in, Priority { prio :: Int, value :: a } is a monoid by taking the value with the higher priority17:18:36
@piegames:matrix.org@piegames:matrix.orgOh, what you're saying is "default values are just merging with priority"?17:19:54
@piegames:matrix.org@piegames:matrix.orgBut how about default values without otherwise merging functionality17:20:11
@piegames:matrix.org@piegames:matrix.org * But how about default values without otherwise merging functionality?17:20:13
@profpatsch:augsburg.oneprofpatschso mkForce just becomes the function mkForce val = Priority { prio = highestPriority, value = val }17:20:20
@profpatsch:augsburg.oneprofpatschactually not sure you want to use monoids here, since having an identity element might not be the default you want in most cases?17:22:40
@profpatsch:augsburg.oneprofpatschso monoid sans empty element might be a better choice17:22:53
@profpatsch:augsburg.oneprofpatschpiegames: I guess default values could just be values with very low priority?17:23:59
@profpatsch:augsburg.oneprofpatschidk17:24:01
@profpatsch:augsburg.oneprofpatschI mean if you think about it nixos configs are very similar to CSS in that regard17:24:34
@profpatsch:augsburg.oneprofpatschmkForce is !important17:24:38
@piegames:matrix.org@piegames:matrix.orgThe thing I don't like priority for, is that now you have to track which values are actual values, and which values are priority annotation wrapping a value.17:25:18
@profpatsch:augsburg.oneprofpatschthus is the tyranny of structured typesystems17:26:30
@profpatsch:augsburg.oneprofpatsch*structural17:26:38
@pyrox:pyrox.devdish [Fox/It/She] changed their display name from Pyrox [ She/They/Xem ] to Pyrox [ It/She/They/Xem ].20:43:38

Show newer messages


Back to Room ListRoom Version: 9