私はocaml_pluginを使用して、実行時にOCaml式を評価できる電卓を作成しています。 これは私のプラグインインターフェイスです。 open Ocaml_plugin.Std
module type S = sig
val f : unit -> float
end
let univ_constr : (module S) Ocaml_dynloader.Univ_co
(エラーを混乱)式はint型で期待されていた私のコードエラー:入力-1.0で let safe_log10 = function x -> if (x <= 0.) then None else Some (log10 x);;
を、これは与える: safe_log10 -1.0;;
Error: This expression has type float -> float option