IMHO, the tools for statically reasoning about prefab structs could use a little love. I'm trying to add better contract and type support for prefabs and I feel like I'm rewriting/duplicating boilerplate that should just exist in a `racket/prefab` module (and in fact if you search around you'll see there are a couple places where such boilerplate is lying around the Racket ecosystem).
For example, it would be nice to be able to---with just the prefab keys and field counts in hand---do the following (without _having_ to call `prefab-key->struct-type` and `struct-type-info`):
1. normalize the key to it's canonical compact form,
2. normalize the key to it's canonical verbose form (if this is actually a sensible thing to do; there's currently a function like this in Typed Racket's implementation),
3. decide if a prefab key is compatible with a particular field count,
4. decide if one prefab-key+field-count is a "subtype/subkey" of another prefab-key+field-count,
5. extract a descriptor for the immutable/mutable fields given a prefab-key+field-count
6. inquire if a particular field is mutable/immutable for a given prefab-key+field-count (w/o allocating)
7. extract a parent prefab-key+count
etc (Carl's `mischief/struct` has more that people might consider useful)
Assuming at least some of those are useful and desirable, would it be better to:
2. Re-implement each desired function at the Racket level in a `racket/prefab` module so there is one canonical place for this kind of boilerplate?
3. Something else sensible?
Best,
Andrew