I'm new to OCaml. I installed utop(version 2.6.0) with latest homebrew on MacOS, installed libraries with opam install core base.
Here's my .ocamlinit:
#use "topfind";;
#thread;;
#require "core.top";;
open Base;;
open Core;;
I met an error of type FI:
utop # FI;;
Line 1, characters 0-2:
Error: The constructor FI expects 3 argument(s),
but is applied here to 0 argument(s)
What's type FI in OCaml ?
Here's type info introduced in TAPL(https://www.cis.upenn.edu/~bcpierce/tapl/): type info = FI of string * int * int | UNKNOWN,
What's type UNKNOWN in OCaml ?
As all the commenters are telling you, StackOverflow is not a good place to learn a new language by asking questions. It will be much, much more productive for you to start by reading through a tutorial on OCaml, say at the OCaml Learning page.
To answer your questions here, neither of these identifiers (
FIorUNKNOWN) means anything in particular "in OCaml". They're just upper-case identifiers that can be defined to be many possible things. In your case they are defined by the type definition you cite:This defines the names
info,FI, andUNKNOWN. The latter two are the "constants" of a new type namedinfo. The first constant (called a value constructor actually),FI, is a way of collecting up a string and two ints into a unit with the tagFI. The second one is just a simple value that doesn't collect up any data. It's similar in a way toNULLin some other language, in that it says there is no interesting data.