将OCaml转换为F#:将OCaml open_box和close_box转换为F# [英] Converting OCaml to F#: Converting OCaml open_box and close_box to F#
问题描述
我正在将基于OCaml的多个模块转换为F#,并使用OCaml打印格式化功能 open_box和close_box (来自OCaml格式模块).在阅读完有关打印盒的概念之后,这是有道理的,但似乎需要在幕后进行大量工作才能实现.
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.
是否存在功能上等效的F#模块?
Is there an F# module that is functionally equivalent?
如果没有,那么不必转换OCaml格式模块的某些部分,什么是快速简单的替换功能?
If not, without having to convert portions of the OCaml format module, what are quick and simple replacement functions?
编辑
Jack 的OCaml格式的一部分位于
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.
推荐答案
是否存在功能上等效的F#模块?
Is there an F# module that is functionally equivalent?
否.
如果没有,那么不必转换OCaml格式模块的某些部分,什么是快速简单的替换功能?
If not, without having to convert portions of the OCaml format module, what are quick and simple replacement functions?
printf
以外的任何内容.但是,最近我不得不将Format
模块从OCaml转换为F#,并且只花了几个小时.
Nothing beyond printf
. However, I had to translate the Format
module from OCaml to F# recently and it only took a couple of hours.
这篇关于将OCaml转换为F#:将OCaml open_box和close_box转换为F#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!