Converting OCaml to F#: Converting OCaml open_box and close_box to F#

对着背影说爱祢 提交于 2019-12-12 12:14:42

问题


I am converting several modules based on OCaml to F# and ran into the OCaml print formatting functions open_box and close_box from the OCaml format module. After reading about the concept of a printing box, it makes sense but seems like it needs a lot of work behind the scenes to implement.

Is there an F# module that is functionally equivalent?

If not, without having to convert portions of the OCaml format module, what are quick and simple replacement functions?

EDIT

Jack has a version as part of OCaml Format at FSharpx.Compatibility.OCaml.Format.Format.fs I havent' tested it, but it is the most compelete version I have found at present.


回答1:


Is there an F# module that is functionally equivalent?

No.

If not, without having to convert portions of the OCaml format module, what are quick and simple replacement functions?

Nothing beyond printf. However, I had to translate the Format module from OCaml to F# recently and it only took a couple of hours.



来源:https://stackoverflow.com/questions/10397737/converting-ocaml-to-f-converting-ocaml-open-box-and-close-box-to-f

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!