Conversation
the fact that everything can always be a Pattern (with very few exceptions, like
also not sure about this. even though the function and the method are technically 2 things, they are conceptually the same from a language perspective. i think using the function directly is a very narrow use case, mostly practical for library users. i'm a bit worried that this might clutter the docs with info that is not useful for the majority of users. maybe we need some way of separating docs for library users (technically accurate, less accessible) and repl users (technically less accurate, more accessible)? alternatively, we might need a page that talks about all the "conventions", like "all functions always accept patterns" and "all methods exist as top-level functions as well".
i personally prefer typescript because i've never used closure
that would be awesome |
That makes sense to me. There are some edge cases (I'm thinking of |
Doing a pass at adding some more undocumented functions and eventually adding more type annotations, etc. For now, just focusing on straightforward documentation tasks (though please leave comments or commit to this branch if you have any edits!), but I also have a couple other things in mind that would be good to discuss:
Pattern<number>orPattern<X>etc), but would that be an acceptable replacement fornumber | Pattern? I think so, but could be convinced if we really want to emphasize that primitive values are acceptable and will be automatically reified.@signaturetag in cases (such asstackor especiallylayer) where the two usages are distinct. This would require a new jsdoc extension, but I don't think it's very complicated.@param {function(Hap):boolean}) versus the Typescript style (@param {(hap: Hap) => boolean})? I prefer Typescript but don't mind the Closure style either. Both work in VS Code's jsdoc parser and unfortunately neither is actually supported by the jsdoc library, so we'd need an extension in either case.@internaltag that disables autocomplete and maybe also hides them from the reference until we can improve the reference UI?