Allow Some Polymorphism for Records #846
keyan-m
started this conversation in
Core language features
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.
-
What are Constrained Polymorphic Records?
Inspired by "extensible records" in Elm programming language, a record type that is constrained to having a set of specific fields, while free to have arbitrary fields otherwise, can be defined as a constrained polymorphic record.
What is the advantage?
Allows for defining more abstract functions, which can potentially pave the way for having more developer-friendly packages with minimal overhead.
A sample use case can be:
How can this be accomplished?
As pointed out by @rvcas, order of values matter in UPLC, therefore this may not be a trivial feature to add. However, at this stage it's probably best to first discuss whether this is desirable in the first place, and what are its pros/cons.
Beta Was this translation helpful? Give feedback.
All reactions