Reason
  • ドキュメント
  • 試してみる
  • API
  • コミュニティ
  • ブログ
  • Languages icon日本語
    • English
    • Deutsch
    • Español
    • Français
    • 한국어
    • Português (Brasil)
    • Русский
    • Українська
    • 中文
    • 繁體中文
    • 翻訳を助ける
  • GitHub

›Advanced Features

はじめに

  • What & Why

セットアップ

  • インストール
  • エディタのプラグイン

言語の基本

  • 概要
  • Let Bindings
  • Primitives
  • Basic Structures
  • Types
  • Records
  • Variants
  • Options and nullability
  • Functions
  • Recursion
  • 構造化代入
  • Pattern Matching
  • Mutable Bindings
  • Loops
  • Modules

Advanced Features

  • JSX
  • External
  • 例外
  • Object

JavaScript

  • Interop
  • Syntax Cheatsheet
  • Pipe First
  • Promise
  • ライブラリ
  • JS からの変換

Extra

  • よくある質問
  • Extra Goodies
Translate

External

external、または、"FFI" (foreign function interface)、単に "interop"(相互運用性のための)は、Reason が他言語(C や JavaScript など)と通信する手段です。

Imagine writing a let binding, but with its body omitted and its (mandatory) type written down:

external myCFunction: int => string = "theCFunction";

Note: externals can only be at the top level, or inside a module definition. You can't declare them in e.g. a function body.

使い方

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.

← JSX例外 →
  • 使い方