External
L'external
, ou "IFE" (Interface de Fonction Étrangère), ou simplement "interop" (pour "interopérabilité") est la façon dont Reason communique avec d'autres langages, comme C ou JavaScript.
Imaginez que vous écrivez un binding let, mais en omettant son contenu et en le typant (obligatoire) :
external myCFunction: int => string = "theCFunction";
Note: external
s can only be at the top level, or inside a module definition. You can't declare them in e.g. a function body.
Utilisation
You'd use an external value/function as if it was a normal let binding.
For more infos on how to link up your C functions within your Reason application, have a look at the Dealing with foreign libraries section in the dune
build system docs.