summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana N. Xu <na.xu@inria.fr>2010-11-23 15:34:14 +0000
committerDana N. Xu <na.xu@inria.fr>2010-11-23 15:34:14 +0000
commit5e76542c1ad68c04717fa6937021d28693e2b4b9 (patch)
tree551be5c4b742f469be7b9d5e7d5fb9fe4672eb91
parent1106acaae9c3331988ff1c6dbf1093c190232441 (diff)
downloadocaml-5e76542c1ad68c04717fa6937021d28693e2b4b9.tar.gz
readme first
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/contracts@10850 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--readmeFIRST.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/readmeFIRST.txt b/readmeFIRST.txt
index c219ef264e..19f72ae3bf 100644
--- a/readmeFIRST.txt
+++ b/readmeFIRST.txt
@@ -27,6 +27,19 @@ e.g.4 {x | x > 0} * {y | y < 0} -> {z | z = x + y}
Note that, we do not support dependent tuple contract yet, i.e.
NO {x | x >=0} * {y | y > x}
+Currently, only toplevel contract declaration is allowed.
+e.g.5
+contract f = {x | x >= 0} -> {y | y > x}
+let f x = x + 5
+
+Contracts are declared directly in .ml files with the keyword "contract". Exported contracts are in .mli files where they should be syntactically the same as those in .ml files and declared after their types.
+
+e.g.6 (in a .mli file)
+val f: int -> int
+contract f = {x | x >= 0} -> {y | y > x}
+
+It is possible not to write a .mli file. In this case, all contracts declared in
+the .ml file are presumed to be exported.
*To test contract checking with some small examples, you can download examples from