-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sentinel value for recursive types #4
Comments
@davidchambers I think a sentinel makes for a cleaner/clearer API. Whichever name you prefer is fine with me. I also agree an explicit value for the recursive type reference is a better choice. Pending your decision on #6 of course, I say 👍 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Haskell:
JavaScript:
There's also a hack which looks better but relies on confusing JavaScript behaviour and doesn't work with
const
.If we're to use a sentinel value (such as
undefined
), why not use one which is more descriptive? We could support one of the following:The value of
Type.Self
(or whatever we were to call it) could simply beundefined
, but I'd prefer something like{'@@functional/recursive-type-reference': true}
.What do you think, @JAForbes? Do you agree that one of these would be better than
undefined
? If so, what would you like the property to be named?The text was updated successfully, but these errors were encountered: