-
Notifications
You must be signed in to change notification settings - Fork 40
Consider type system alternative for stringly typed values #108
Comments
TIL the name for single-valued types (newtypes) -- this looks preferable to aliasing. Some considerations:
Some reasons for my preference in not using STVs:
|
We can make the newtypes effectively passthrough for this usecase by implementing
Probably! Especially as we delve into supporting other DID methods..
Maybe some good ideas for us to borrow, but my intuition is that these are human-read and human-written identifiers that need a human-readable representation. Even though they are very unpleasant to read, they need to be represented as strings. As for reasons not to use STVs, no argument against that at all, I'm on the same page. |
At this point, I'm going to call this closed as we have deployed a newtype pattern to solve this as of #141 |
We have a number of cases where parameters are string types: UCAN JWT strings, base64-encoded CIDs/signatures/whatever, DID strings.
The possibility that we might improve the legibility of these values came up in #107 (comment).
Let's discover the best approach to representing these stringly typed values in code and apply this strategy broadly in our code base. Type aliases and newtypes are worth considering, but there may be other alternatives.
The text was updated successfully, but these errors were encountered: