“Learn You a Haskell[1], and Real World OCaml[2] were what got me started.”
Real World OCaml
面向工业实践的 OCaml 教程,从语法到模块、函子和错误处理
Yaron Minsky 和 Anil Madhavapeddy 写的 OCaml 教程,面向想把 OCaml 用到真实项目里的人。书从基本语法和函数式编程讲起,再深入记录、变体、错误处理、模块与函子(functor)等特色功能,并介绍 opam 等开发工具。和偏理论的函数式编程教材相比,它更强调实际工程中会用到的写法和库。第二版有更新,内容较前一版更深入。
HN 上多数人把它当作学 OCaml 最好的现行资料来推荐,常见理由是免费在线、适合上手、对模块、函子、多态变体和错误处理等主题讲得好;没有明显的批评意见。
想认真学 OCaml 的有经验程序员
怎么读
由 Claude 根据这本书和 HN 上的说法整理,可能有错- 1先按书中说明用 opam 装好开发环境,再往下读
- 2前面章节快速过一遍,重点放在模块系统和函子
- 3边读边在 REPL 或项目里写代码,别只看
- 4遇到标准库差异时,对照最新版本的文档
HN 书评
推荐在前,同类按时间 · 每本最多保留 20 条,统计用全部提及 · 作者本人贴的不算“You will find plenty of exemples in the Ocaml manual (the whole chapter 2 is on the module system [1]) and beginner focused books however (chapter 4, 9 and 10 of Real World Ocaml [2]).”
“But if nothing else, be sure to check out Real World OCaml[1]. It's pretty great and helped me out a lot getting started.”
“(Real World OCaml is the best at the moment, I believe)”
“For those looking for a slightly more comprehensive source, check out Real World OCaml (no affiliation).”
“Discovered the Real World OCaml [0] book and was instantly hooked.”
看全部 20 条 →
“A good discussion of this can be found in Real World OCaml”
“If you want to learn Ocaml, probably the best current resource is Real World Ocaml v2: Real World OCaml.”
“I'd start here: Real World OCaml for installing the basic compiler and tools: essentially, use your OS package manager to install opam, and then use opam to install everything else. Then work through the rest of the book.”
“See Real World OCaml for more examples.”
“After that, I would recommend the new (beta) version of Real World OCaml — it gets a lot more in depth about more advanced language features: Real World OCaml”
“If you want to learn OCaml, you should probably check Real World OCaml (free to read online)”
“Here's a resource, though: [4].”
“Real World Ocaml is a decent resource: Real World OCaml”
“most learners eventually gravitate towards Real World OCaml Real World OCaml for additional learning.”
“is also one of the two authors of Real World OCaml[1] which is a good resource on the language.”
“In particular, the section "Standard libraries", I'd recommend looking at:”
“For further reading, I really like this piece from the book Real World OCaml, which also has a Result type and exceptions: Real World OCaml.”
“It's probably the path of least resistance if following the Real World OCaml book, which is quite excellent.”
“There is a work-in-progress second edition of "Real World OCaml" book [1], which has many small but vital updates”