[英]higher order modules in OCaml
Higher-order functors are supported and work as expected:支持高阶仿函数并按预期工作:
module type endo = sig
module type t
module F: t -> t
end
module Twice(F:endo) = struct
module type t = F.t
module F(X:t) = F.F(F.F(X))
end
The manual merely considers that it is a not surprising feature.该手册仅认为这是一个不足为奇的功能。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.