@acset_colim variants: exposing name mapping, and morphisms #986
@acset_colim variants: exposing name mapping, and morphisms #986kris-brown wants to merge 3 commits intomainfrom
@acset_colim variants: exposing name mapping, and morphisms #986Conversation
|
Moving some discussion from the Zulip here. Having some experience with these new macros now, I think that it might be unwise to have macro named_acset_colim(yon, body)
quote
colimit_representables($(parse_diagram_data(body, __module__)), $(esc(yon)))
end
end |
|
|
||
| # If we are just asking for a coproduct of representables | ||
| isempty(spans) && return apex(Σ) | ||
| isempty(spans) && return (names, apex(Σ)) |
| ACSet with src=1 and tgt=2. However, unlike `@acset_colim`, this also assigns | ||
| to a variable MyDomain the NamedTuple `(v=(:V, 1),e=(:E, 1))`. | ||
| """ | ||
| macro named_acset_colim(yon, names_var, body) |
There was a problem hiding this comment.
Comment on the PR moved here: #986 (comment)
Having some experience with these new macros now, I think that it might be unwise to have @named_acset_colimit implemented the way it is because it is not referentially transparent -- the names appear effectively by side-effect. This more functional (and simpler!) implementation might be better:
macro named_acset_colim(yon, body)
quote
colimit_representables($(parse_diagram_data(body, __module__)), $(esc(yon)))
end
end| end | ||
| ``` | ||
|
|
||
| This would behave like `@acset_colim` and assign to `Dom` the walking edge |
There was a problem hiding this comment.
Probably ought to change the comment too:
This would behave like `@acset_colim` and assign to `Dom` the walking edge
ACSet with src=1 and tgt=2. However, unlike `@acset_colim`, this returns the pair
`(names, colimit)` where `names = (v=(:V, 1),e=(:E, 1))`.
This draft introduces two new macros related to
@acset_colim. The first,@named_acset_colim, takes in an extra parameter which will be assigned a NamedTuple relating the names of the generators to their respective elements (Pair{Symbol, Int}).The second
@acset_transformation_colim, accepts two@acset_colim-style expressions as well as a sequence of pairs (which initializing a hom search) as well as keyword arguments for hom-search.In order for this to truly work, the data of
yonedais actually not enough. We are missing the data of, in a representableFoo, which element is the representing element. For example, the representable edge in a reflexive graph has three edges in it. Only one of them is the representing element. Presently, for simplicity so that the same data can be plugged into@acset_colimand these macros, we throw an error if there is any ambiguity in what the representing element is.