singleton types #393
amitu
started this conversation in
Ideas & RFCs
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Sometimes we want to store some data about the document. Such data must only be present once in the document. Some types can be marked as singleton to force ftd to only allow one such instance per document. The instance may even be anonymous.
If you want to use the person data in rest of the current document you can do bind it to a name.
If you want to access such data from other documents you can either use the
package query mechanismor bind them to a name (do not create anonymous instance).Once type alias is implemented we can even make other types singleton:
Now we have created a type called
titleand it is marked singleton, but it is just a string.Challenge
In a document that queries such records defined in other documents, do we still enforce singleton rule?
Beta Was this translation helpful? Give feedback.
All reactions