Coding 2023-06-29
Okay. I had a look at how the different structures with some group properties relate, and I don't think I can "just ignore" stuff like associativity, because of how it seems to interact with divisibility.
Trying to state what I actually want to accomplish here:
Any given structure should be able to specify "laws" that its operations satisfy, both as a run-time specification of a test, and as a compile-time specification of "capabilities that the module provides". Because this doesn't necessarily relate to a single function or value, I want to somehow tag this information to the module itself. Which means having something else in the struct to hold that static and run-time information. I can't see any way through this that doesn't involve somehow constructing an intersection of types, be they module types, object types, or something else.
One thing that might help constrain what I'm looking for is to consider what the tests look like. If I'm requiring that every property can be "pulled off" of the module where it definitely applies, then it needs to carry a reference to that module. For now, let's assume that I probably shouldn't do that.
I'm going to try to revisit one of my original ideas... Hm. Wouldn't work, but now I'm curious about module constraints and extensions...
Ugh. Nothing is coming together with this, so I'm looking at how other people have done stuff in this area. I think I want to just swipe how other people have done this, and try to extend that with tests of the laws.
Maybe I can try that out later. For now, I need to wind down.
Good night.