Is export a key word in rescript?

Is export a keyword in rescript?

export is a keyword and it’s related to gentype iirc
I’m not sure but I think

export a = 2

is equivalent to

@genType
let a = 2

I have the urge to explain what was going on here: So yes, there are some pretty early experiments for an export keyword to have tighter integration with genType, but those experiments are still ongoing, and not relevant for now.

This feature is by no means supposed to be exposed already, it unintentionally snuck through the release wrap-up. GenType’s example codebase is a pretty important testing ground for all kinds of features, so I am not surprised it was covered in there.

In an upcoming ReScript release the export syntax will be hidden again and your code will reprint back to @genType annotated let bindings (no breaking changes).

3 Likes