summaryrefslogtreecommitdiffhomepage
path: root/ocaml.html.markdown
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2014-09-12 19:34:50 +0700
committerDaniil Baturin <daniil@baturin.org>2014-09-12 19:34:50 +0700
commitd9110cf7bc8a3dcf84207ea509340dbae868a44a (patch)
treeb1fd2ba57307f5a663f8e7c1377ece33294ee373 /ocaml.html.markdown
parent55c269cc3c6a5678bbff3effc587edb7a1cd6e8a (diff)
An overly simplified explanation of currying in OCaml tutorial.
Diffstat (limited to 'ocaml.html.markdown')
-rw-r--r--ocaml.html.markdown10
1 files changed, 8 insertions, 2 deletions
diff --git a/ocaml.html.markdown b/ocaml.html.markdown
index 8638a291..fd5b9b2e 100644
--- a/ocaml.html.markdown
+++ b/ocaml.html.markdown
@@ -31,7 +31,7 @@ val a : int = 99
```
For a source file you can use "ocamlc -i /path/to/file.ml" command
-to print all names and signatures.
+to print all names and type signatures.
```
$ cat sigtest.ml
@@ -47,7 +47,13 @@ val a : int
```
Note that type signatures of functions of multiple arguments are
-written in curried form.
+written in curried form. A function that takes multiple arguments can be
+represented as a composition of functions that take only one argument.
+The "f(x,y) = x + y" function from the example above applied to
+arguments 2 and 3 is equivalent to the "f0(y) = 2 + y" function applied to 3.
+Hence the "int -> int -> int" signature, which can be read as
+"(int -> int) -> int".
+
```ocaml
(*** Comments ***)