Closed davidchambers closed 4 years ago
I'm not sure why you would leave out the weak variants. Is it to discourage usage of them?
Weak sets can only contain objects, so the type would be JsWeakSet
rather than JsWeakSet a
. Similarly, weak maps can only contain objects as keys, so the type would be JsWeakMap a
rather than JsWeakMap a b
. The values of a weak map are not enumerable, though, so the extractor would have to be jsWeakMap => []
.
These quirks deterred me, but if you think we should define $.JsWeakSet
and $.JsWeakMap
I will do so in a separate pull request. :)
I see. Sounds good to me. Let's leave the weak variants to be defined by users. We can always make another PR as you said.
Closes #183
I set out to define
$.JsWeakSet
and$.JsWeakMap
as well, but I decided not to do so when I learnt how strangeWeakSet
andWeakMap
are. Users can define (nullary) types for these if necessary.