F#更改为OCaml [英] F# changes to OCaml

查看:73
本文介绍了F#更改为OCaml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

F#源自OCaml,但是缺少或添加了哪些主要项目?具体来说,我对于可用于学习OCaml的资源是否也对想学习F#的人有用感到好奇.

F# is derived from OCaml, but what major items are missing or added? Specifically I'm curious as to whether the resources available for learning OCaml are also useful to someone who wants to learn F#.

推荐答案

主要区别在于F#不支持:

The main differences are that F# does not support:

  • functors
  • OCaml样式的对象
  • 多态变体
  • camlp4/5预处理器或扩展点(ppx)

此外,F#对于标记和可选参数具有不同的语法.

In addition, F# has a different syntax for labeled and optional parameters.

理论上,不使用这些功能的OCaml程序可以使用F#进行编译.学习OCaml是对F#的完全合理的介绍(反之亦然,我想).

In theory, OCaml programs that don't use these features can be compiled with F#. Learning OCaml is a perfectly reasonable introduction to F# (and vice versa, I'd imagine).

差异的完整列表为

The complete list of differences is here (note: archive.org replacement of dead link).

这篇关于F#更改为OCaml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆