Commit f18e9dd0 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2004-06-28 22:37:58 by beppe] back the table

Original author: beppe
Date: 2004-06-28 22:37:58+00:00
parent 0cb26876
......@@ -55,7 +55,7 @@ Basic OCaml types <code>char</code>, <code>int</code>, <code>string</code>,
</p>
<p>
Tuple types <code>t1 * ... tn</code> are translated to nested CDuce
Tuple types <code>t1 * ... * tn</code> are translated to nested CDuce
product types <code>(T(t1),(...,T(tn))...)</code>. A function type
<code>t -> s</code> is translated to <code>T(t) -> T(s)</code>.
Labels and optional labels on the argument of the arrow are discarded.
......@@ -102,6 +102,28 @@ identity. This can be used to avoid multiple copies when translating
a complex value back and forth between CDuce and OCaml.
</p>
<p>
The canonical translation is summarized in the following box
</p>
<sample><![CDATA[
T($$bool$$) = Bool
T($$char$$) = Char
T($$int$$) = -1073741824 -- 1073741823
T($$string$$) = Latin1
T($$unit$$) = []
T($$%%t%%$$ $$*$$ $$%%u%%$$) = ( T($$%%t%%$$) , T($$%%u%%$$) )
T($$%%t%%$$ $$->$$ $$%%u%%$$) = T($$%%t%%$$) -> T($$%%u%%$$)
T($$%%t%%$$ $$|$$ $$%%u%%$$) = T($$%%t%%$$) | T($$%%u%%$$)
T($$%%t%%$$ $$list$$) = [ T($$%%t%%$$)* ]
T($$A$$) = `A
T($$A of$$ $$%%t%%$$) = ( `A, T($$%%t%%$$) )
| { u : T($$%%t%%$$) } if in contravariant (argument) position
T($${ u :$$ $$%%t%%$$ $$}$$) = <
| {| u : T($$%%t%%$$) |} if in covariant (result) position
]]></sample>
<p>
A <em>monomorphic</em> abstract type <code>t</code> is translated to
the CDuce type <code>!t</code>. This type just acts as a container for
......@@ -135,6 +157,7 @@ can't, because its infinite unfolding is not a regular type.
OCaml object types are not supported.
</p>
</box>
<box title="Calling OCaml from CDuce" link="call_ocaml">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment