-
-
Notifications
You must be signed in to change notification settings - Fork 250
Cheat sheet for annotations #572
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
Comments
How to describe the difference between |
I didn't know, but are the $1, $2 placeholder a thing? |
Just a compact notation to describe what the examples do. But once all the uses of attributes are lined out, it might suggest a decent universal representation. |
Looks like So it becomes about runtime representation and not about FFI. |
Just used |
Since import wasn't well received, a couple of ideas for importing values from javascript: external "path" {
dirname: string => string,
renameSync as rename: (string, string) => string,
"weird identifier" as ident: unit => unit
}
// entire module contents
external "leftPad" {
* as leftPad: (string, int) => string
}
// import default export
external "./modules/school.js" {
default as schoolName: string,
}
// or simply: (this could be too much)
external "./modules/school.js" as schoolName: string |
@cristianoc is this issue about having a separate page that lists all possible constructs in one example? Or are you talking about extending our syntax lookup, that lists all the decorators already? |
This is not necessarily about description only. It could be a different way to express FFI in future. Perhaps not super relevant for the doc site right now. |
A few additional comments from discussions with folks
|
Present a compact cheat sheet for decorators relevant for code generation. Here's a list of all decorators. Irrelevant ones to be removed:
@@deprecated@@warning@as("someString") _
@bs.send.pipe@dead@deprecated@derivingAbout runtime representation@doesNotRaise@genType@inline@intnot relevant: about runtime representation@LiVe@methAbout runtime representation@raises@react.component@stringnot relevant: about runtime representation@unboxedAbout runtime representation[#Int(int) | #Str(string)]
). Should probably be a language-level featureeither<(int, string)>
.A few examples covered:
The text was updated successfully, but these errors were encountered: