Dynamic variant construction (wrap) #149
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
refactor
rust
technical-debt
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
navicore/patch-seq#149
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
SON (Seq Object Notation) needs to construct variants dynamically from symbols:
Currently, variants require static constructors generated from union definitions:
Proposed Words
Design Questions
1. Tag Resolution
How does
:somebecome tag1?Option A: Global tag registry
:someassigns it tag1, memoizedOption B: Union-based lookup
wrapsearches defined unions for matching variant nameOption C: Structural/untyped
2. Type System Impact
What type does
wrapreturn?Options:
Variant(opaque, loses type info)∃T. T3. Arity
How does
wrapknow how many values to consume?wrap-0,wrap-1,wrap-2, etc.:some/1(like Erlang atoms)42 :some 1 wrapRelation to SON
This is the key feature that makes SON expressive:
Without
wrap, SON files must import union definitions, defeating portability.Part of the SON implementation roadmap.
Depends on: #148 (symbol syntax)
https://github.com/navicore/patch-seq/pull/168