PolymerLabs / arcs

Arcs
BSD 3-Clause "New" or "Revised" License
56 stars 35 forks source link

Recursive Schema support #7128

Open shans opened 3 years ago

shans commented 3 years ago

(from b/172182382)

Arcs types do not currently support recursion or co-recursion (e.g. https://en.wikipedia.org/wiki/Recursive_data_type).

There has been some interest in supporting co-recursion and (less) interest in recursion. e.g.

schema Employee
   name: Text
   manager: &Employee // Here's the recursion

Note: Inline recursion should still be an error (to avoid unbounded schema size), recursion needs to broken by an nullable/optional field or some kind of a list/collection field (otherwise these schemas cannot be constructed).