-
Notifications
You must be signed in to change notification settings - Fork 7
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
Question: Runtime representation #24
Comments
From JS perspective is there any difference? |
let x = {};
let y = {foo: undefined};
x.hasOwnProperty("foo"); // false
y.hasOwnProperty("foo"); // true
Object.keys(x); // []
Object.keys(y); // ["foo"] |
Ah yeah. So it can break someones equality assumption etc. I'm a bit confused - can we keep this ambiguity - it seems handy. What do you think Guys? So for example at the end the type
|
Well I presume there's a big difference memory-wise. I use this to construct some potentially very large records but practically tiny records in FFI. The reason I noticed is that react was complaining about a prop name that didn't exist, but I wasn't really passing that prop (Bing is quite a bit worse at generating FFI than ChatGPT by the way). So it was actually nice to find out that that key I didn't have example coverage was wrong. subContent ∷
∀ p kids. Coerce p DropdownMenuSubContentProps ⇒ ToJSX kids ⇒ p → kids → JSX
subContent props kids = React.element subContentImpl
$ (coerce props ∷ DropdownMenuSubContentProps) # RB.build
( RB.insert (Proxy ∷ _ "children") kids
) |
That is strange. The lib can add a prop to the record if you build it using:
But I would like to leave it as it seems handy - I can document this behavior. What do you think? |
Does the runtime representation look like this:
Or
?
The text was updated successfully, but these errors were encountered: