6 Matching Annotations
  1. Nov 2022
    1. This project file is needed in the root directory of every source tree that you want to compile with Dune. In general, you’ll have a dune file in every subdirectory of the source tree but only one dune-project file at the root.

      dune 文件用来制定每个 sub-directory 如何编译;而dune-project 文件用来指定整个项目的编译配置

    1. let increment x = x + 1

      Ocaml 中函数定义的语法和变量定义的语法基本一致,这让 “函数也是一种数据” 变得更加显然。

    1. There are five essential components to learning a language: syntax, semantics, idioms, libraries, and tools.


    1. Parametric polymorphism: Functions and data structures can be parameterized over types. This is crucial for being able to re-use code.


    1. A switch is a named installation of OCaml with a particular compiler version and set of packages.

      switch 是一个 ocaml 的虚拟环境,类似于 python 中的 virtual-env

    2. Here’s what we’re going to install: A Unix development environment OPAM, the OCaml Package Manager An OPAM switch with the OCaml compiler and some packages The Visual Studio Code editor, with OCaml support

      OCaml 开发环境创建