aboutsummaryrefslogtreecommitdiff
path: root/doc/sphinx
diff options
context:
space:
mode:
authorKazuhiko Sakaguchi2020-01-14 20:29:24 +0900
committerKazuhiko Sakaguchi2020-01-14 20:29:24 +0900
commit85f38599f59ada198260870aa64703348e739bd8 (patch)
treeca6b038f894769a43b865a8313585d8bda3f681e /doc/sphinx
parent507141cb978ae9383b79e4a6af6ab968cb8d540e (diff)
parentfcc3d7c64cc3d6f8f60e0e0f9469a78009b7fbd2 (diff)
Merge PR #10486: [extraction] Support extraction of Coq's string type to OCaml's string type
Ack-by: SkySkimmer Ack-by: Zimmi48 Ack-by: ejgallego Reviewed-by: herbelin Ack-by: maximedenes Reviewed-by: pi8027
Diffstat (limited to 'doc/sphinx')
-rw-r--r--doc/sphinx/addendum/extraction.rst13
1 files changed, 10 insertions, 3 deletions
diff --git a/doc/sphinx/addendum/extraction.rst b/doc/sphinx/addendum/extraction.rst
index 7136cc28d1..d909f98956 100644
--- a/doc/sphinx/addendum/extraction.rst
+++ b/doc/sphinx/addendum/extraction.rst
@@ -313,14 +313,21 @@ The system also provides a mechanism to specify ML terms for inductive
types and constructors. For instance, the user may want to use the ML
native boolean type instead of the |Coq| one. The syntax is the following:
-.. cmd:: Extract Inductive @qualid => @string [ {+ @string } ]
+.. cmd:: Extract Inductive @qualid => @string__1 [ {+ @string } ]
Give an ML extraction for the given inductive type. You must specify
- extractions for the type itself (first :token:`string`) and all its
- constructors (all the :token:`string` between square brackets). In this form,
+ extractions for the type itself (:n:`@string__1`) and all its
+ constructors (all the :n:`@string` between square brackets). In this form,
the ML extraction must be an ML inductive datatype, and the native
pattern matching of the language will be used.
+ When :n:`@string__1` matches the name of the type of characters or strings
+ (``char`` and ``string`` for OCaml, ``Prelude.Char`` and ``Prelude.String``
+ for Haskell), extraction of literals is handled in a specialized way, so as
+ to generate literals in the target language. This feature requires the type
+ designated by :n:`@qualid` to be registered as the standard char or string type,
+ using the :cmd:`Register` command.
+
.. cmdv:: Extract Inductive @qualid => @string [ {+ @string } ] @string
Same as before, with a final extra :token:`string` that indicates how to