【发布时间】:2014-04-21 16:46:47
【问题描述】:
假设你有一些这样的代码
type foo_t = int64
let do_something_with_foo (f : foo_t) = (* left to your imagination *)
你想用一个常量“foo”来调用它,像这样:
do_something_with_foo 99
你如何让编译器/解释器相信你的常量 99 实际上是一个foo_t?
【问题讨论】:
标签: type-conversion ocaml type-inference