Hi Philip, Philip McGrath <phi...@philipmcgrath.com> skribis:
> Racket's state-of-the-art contract system has many features and nuances. I *do > not* think anyone should try to implement them all in one fell swoop. I'm > hoping there's a way to implement your simple assertions with only a modest > amount of overhead that will provide the right base on which to grow the rest > of a contract system. In the short term, the advantage over: > >> (assert-type (listof service?) services >> "SERVICES must be a list of <service> values.") > > is that you don't have to write error messages by hand. > > You need two types of values: > > 1. Contracts, recognized by `contract?`; and > 2. Blame objects, recognized by `blame?`. [...] Thanks for the explanation and references! I had briefly looked at Racket’s contract API in the past but your message gave a clearer view of how this all fits together. > I would love to have contracts in Guix, even very rudimentary contracts. If > it's something the community more generally would be interested in, I'd be > glad to help as much as I can. It’d be great to benefit from your expertise here. Like you wrote, I think we should start with a simple contract system, certainly simpler than Racket’s, and build from there. If you’re willing and able to spend time prototyping this, that’s great. :-) Thanks, Ludo’.