Syntax Lookup

Enter some language construct you want to know more about.
This is the @string decorator.

The @string decorator can be applied to polymorphic variant declarations.

Example

ReScriptJS Output
@val external setStatus: @string[
  @as("NOT_STARTED") #NotStarted |
  @as("STARTED") #Started |
  @as("DONE") #Done
] => unit = "setStatus"

setStatus(#NotStarted)

References