Oh how the wheel turns. @sjbreiner, see what you think of this. I think it manages to make pretty good use of the Scala type system to actually get some pretty tight invariants on acset use.
I think it should be possible to do serialization pretty cleanly with this type of design. Note that there needs to be a couple more "hooks" to get, say, cascade deletion working, but that shouldn't be so bad.
Of course, these are not nested. I have to think about how to do nesting with this approach, but I've been working out the math of this slowly, so hopefully I'll have some better idea soon.
One nice thing this enables is exhaustive pattern matching on the type of a part when using a static schema.
Oh how the wheel turns. @sjbreiner, see what you think of this. I think it manages to make pretty good use of the Scala type system to actually get some pretty tight invariants on acset use.
I think it should be possible to do serialization pretty cleanly with this type of design. Note that there needs to be a couple more "hooks" to get, say, cascade deletion working, but that shouldn't be so bad.
Of course, these are not nested. I have to think about how to do nesting with this approach, but I've been working out the math of this slowly, so hopefully I'll have some better idea soon.
One nice thing this enables is exhaustive pattern matching on the type of a part when using a static schema.