You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Like this you are not obligated to create a custom Sunroof type. You can just reuse a type like JSObject as encoding of your record. It would still leave you the possibility to create your own Sunroof type. The ability to reuse a type like JSObject would also allow implementing different interpretations of the same object and by that providing some sort of inheritance mechanism as it is used in JavaScript all the time. Also this might give a possiblility to do type safe inspection of exisiting types by exposing their attributes as a record, although that is already possible by creating proper bindings for the attr combinator.
Though I do not have a good example of this and of course there is a risk that people do garbage with this like misusing type like JSDate.
The text was updated successfully, but these errors were encountered:
Right now
JSTuple
looks like this:This ensures that you create
Sunroof
type that accompanies yourInternals
type and by that create a proper abstraction of your new record.An alterntive to this approach would be to do something like this:
Like this you are not obligated to create a custom
Sunroof
type. You can just reuse a type likeJSObject
as encoding of your record. It would still leave you the possibility to create your ownSunroof
type. The ability to reuse a type likeJSObject
would also allow implementing different interpretations of the same object and by that providing some sort of inheritance mechanism as it is used in JavaScript all the time. Also this might give a possiblility to do type safe inspection of exisiting types by exposing their attributes as a record, although that is already possible by creating proper bindings for theattr
combinator.Though I do not have a good example of this and of course there is a risk that people do garbage with this like misusing type like
JSDate
.The text was updated successfully, but these errors were encountered: