AlgebraicJulia / Semagrams.jl

A graphical editor for graph-like structures
https://algebraicjulia.github.io/Semagrams.jl/
MIT License
91 stars 10 forks source link

Return to Typed ACSets #109

Closed olynch closed 1 year ago

olynch commented 1 year ago

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.

olynch commented 1 year ago

This is an idea that will probably be incorporated at some point, but not in this form.