/[svn]/web/manual/types_patterns.xml
ViewVC logotype

Contents of /web/manual/types_patterns.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1702 - (show annotations)
Tue Jul 10 19:15:40 2007 UTC (5 years, 10 months ago) by abate
File MIME type: text/xml
File size: 21642 byte(s)
[r2005-06-07 21:57:41 by beppe] added "else"

Original author: beppe
Date: 2005-06-07 21:57:41+00:00
1 <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
2 <page name="manual_types_patterns">
3
4 <title>Types and patterns</title>
5
6 <box title="Types and patterns" link="gen">
7
8 <p>
9 In CDuce, a type denotes a set of values, and a pattern
10 extracts sub-values from a value. Syntactically, types and patterns
11 are very close. Indeed, any type can be seen as a pattern
12 (which accepts any value and extracts nothing), and a pattern
13 without any capture variable is nothing but a type.
14 </p>
15
16 <p>
17 Moreover, values
18 also share a common syntax with types and patterns. This is motivated
19 by the fact that basic and constructed values (that is, any values without
20 functional values inside) are themselves singleton types.
21 For instance <code>(1,2)</code> is both a value, a type and a pattern.
22 As a type, it can be interpreted as a singleton type,
23 or as a pair type made of two singleton types.
24 As a pattern, it can be interpreted as a type constraint,
25 or as a pair pattern of two type constraints.
26 </p>
27
28 <p>
29 In this page, we present all the types and patterns that CDuce recognizes.
30 It is also the occasion to present the CDuce values themselves, the
31 corresponding expression constructions, and fundamental operations on them.
32 </p>
33
34 </box>
35
36 <box title="Capture variables and default patterns" link="capture">
37
38 <p>
39 A value identifier inside a pattern behaves as a capture variable:
40 it accepts and bind any value.
41 </p>
42
43 <p>
44 Another form of capture variable is the default value pattern
45 <code>( %%x%% := %%c%% )</code> where <code>%%x%%</code>
46 is a capture variable (that is, an identifier),
47 and <code>%%c%%</code> is a scalar constant.
48 The semantics of this pattern is to bind the capture variable
49 to the constant, disregarding the matched value (and accepting
50 any value).
51 </p>
52
53 <p>
54 Such a pattern is useful in conjunction with the first match policy
55 (see below) to define "default cases". For instance, the pattern
56 <code>((x &amp; Int) | (x := 0), (y &amp; Int) | (y := 0))</code>
57 accepts any pair and bind <code>x</code> to the left component
58 if it is an integer (and <code>0</code> otherwise), and similarly
59 for <code>y</code> with the right component of the pair.
60 </p>
61
62 </box>
63
64 <box title="Boolean connectives" link="bool">
65 <p>
66 CDuce recognize the full set of boolean connectives, whose
67 interpretation is purely set-theoretic.
68 </p>
69 <ul>
70 <li><code>Empty</code> denotes the empty type (no value).</li>
71 <li><code>Any</code> and <code>_</code> denote the universal type (all the values); the preferred notation is <code>Any</code> for types
72 and <code>_</code> for patterns, but they are strictly equivalent.
73 </li>
74 <li><code>&amp;</code> is the conjunction boolean connective.
75 The type <code>%%t1%% &amp; %%t2%%</code> has all the values
76 that belongs to <code>%%t1%%</code> and to <code>%%t2%%</code>.
77 Similarly, the pattern <code>%%p1%% &amp; %%p2%%</code> accepts
78 all the values accepted by both sub-patterns; a capture variable
79 cannot appear on both side of this pattern.
80 </li>
81 <li><code>|</code> is the disjunction boolean connective.
82 The type <code>%%t1%% | %%t2%%</code> has all the values
83 that belongs either to <code>%%t1%%</code> or to <code>%%t2%%</code>.
84 Similarly, the pattern <code>%%p1%% | %%p2%%</code> accepts
85 all the values accepted by any of the two sub-patterns;
86 if both match, the first match policy applies, and <code>%%p1%%</code>
87 dictates how to capture sub-values. The two sub-patterns
88 must have the same set of capture variables.</li>
89 <li><code>\</code> is the difference boolean connective.
90 The left hand-side can be a type or a pattern, but the right-hand side
91 is necessarily a type (no capture variable).</li>
92 </ul>
93 </box>
94
95 <box title="Recursive types and patterns" link="recurs">
96 <p>
97 A set of mutually recursive types can be defined
98 by toplevel type declarations, as in:
99 </p>
100
101 <sample><![CDATA[
102 type T1 = <a>[ T2* ]
103 type T2 = <b>[ T1 T1 ]
104 ]]></sample>
105
106 <p>
107 It is also possible to use the syntax
108 <code>%%T%% where %%T1%% = %%t1%% and ... and %%Tn%% = %%tn%%</code>
109 where <code>%%T%%</code> and the <code>%%Ti%%</code> are type identifiers
110 and the <code>%%ti%%</code> are type expressions. The same notation
111 works for recursive patterns (for which there is no toplevel declarations).
112 </p>
113
114 <p>
115 There is an important restriction concerning recursive types:
116 any cycle must cross a <em>type constructor</em> (pairs, records, XML
117 elements, arrows). Boolean connectives do <em>not</em> count as type
118 constructors! The code sample above is a correct definition.
119 The one below is invalid, because there is an unguarded cycle
120 between <code>T</code> and <code>S</code>.
121 </p>
122
123 <sample><![CDATA[
124 type T = S | (S,S) (* INVALID! *)
125 type S = T (* INVALID! *)
126 ]]></sample>
127
128 </box>
129
130
131 <box title="Scalar types" link="basic">
132
133 <p>
134 CDuce has three kind of atomic (scalar) values:
135 integers, characters, and atoms. To each kind corresponds a family of types.
136 </p>
137
138 <ul>
139 <li><b>Integers</b>.
140 <br/>CDuce integers are arbitrarily large. An integer
141 literal is a sequence of decimal digits, plus an optional leading unary
142 minus (<code>-</code>) character.
143 <ul>
144 <li><code>Int</code>: all the integers.</li>
145 <li><code>%%i%%--%%j%%</code> (where <code>%%i%%</code> and
146 <code>%%j%%</code> are integer literals, or <code>*</code>
147 for infinity): integer interval. E.g.: <code>100--*</code>,
148 <code>*--0</code>
149 <footnote>
150 You should be careful when putting parenthesis around
151 a type of the form <code>*--%%i%%</code>. Indeed,
152 <code>(*--%%i%%)</code> would be parsed as a comment.
153 You have to put a whitespace after the left parenthesis.
154 </footnote>
155 (note that <code>*</code> stands both
156 for plus and minus infinity). </li>
157 <li><code>%%i%%</code> (where <code>%%i%%</code> is an integer
158 literal): integer singleton type.</li>
159 </ul>
160 </li>
161
162 <li><b>Floats</b>.
163 <br/>CDuce provider minimal features for floats. The only way to
164 construct a value of type <code>Float</code> is by the function
165 <code>float_of : String -> Float</code>
166 </li>
167
168 <li><b>Characters</b>.
169 <br/>CDuce manipulates Unicode characters. A character
170 literal is enclosed in single quotes, e.g. <code>'a', 'b', 'c'</code>.
171 The single quote and the backslash character must be escaped
172 by a backslash: <code>'\''</code>, <code>'\\'</code>. The double
173 quote can also be escaped, but this is not mandatory.
174 The usual <code>'\n', '\t', '\r'</code> are recognized.
175 Arbitrary Unicode codepoints can be written in decimal
176 <code>'\%%i%%;'</code> (<code>%%i%%</code> is an decimal integer; note that the code is ended by a semicolon) or
177 in hexadecimal <code>'\x%%i%%;'</code>. Any other occurrence of
178 a backslash character is prohibited.
179
180 <ul>
181 <li><code>Char</code>: all the Unicode character set.</li>
182 <li><code>%%c%%--%%d%%</code> (where <code>%%d%%</code> and
183 <code>%%d%%</code> are character literals):
184 interval of Unicode character set. E.g.: <code>'a'--'z'</code>. </li>
185 <li><code>%%c%%</code> (where <code>%%c%%</code> is an integer
186 literal): character singleton type.</li>
187 <li><code>Byte</code>: all the Latin1 character set
188 (equivalent to <code>'\0;'--'\255;'</code>).</li>
189 </ul>
190 </li>
191
192 <li><b>Atoms</b>.
193 <br/>Atoms are symbolic elements. They are used in particular
194 to denote XML tag names, and also to simulate ML sum type
195 constructors and exceptions names.
196 An atomic is written <code>`%%xxx%%</code> where
197 <code>%%xxx%%</code> follows the rules for CDuce identifiers.
198 E.g.: <code>`yes, `No, `my-name</code>. The atom <code>`nil</code>
199 is used to denote empty sequences.
200 <ul>
201 <li><code>Atom</code>: all the atoms.</li>
202 <li><code>%%a%%</code> (where <code>%%a%%</code> is an atom
203 literal): atom singleton type.</li>
204 <li><code>Bool</code>: the two atoms <code>`true</code> and
205 <code>`false</code>.</li>
206 <li>See also: <local href="namespaces"/>.</li>
207 </ul>
208 </li>
209 </ul>
210 </box>
211
212 <box title="Pairs" link="pairs">
213 <p>
214 Pairs is a fundamental notion in CDuce, as they constitute a building
215 block for sequence. Even if syntactic sugar somewhat hides
216 pairs when you use sequences, it is good to know the existence of pairs.
217 </p>
218
219 <p>
220 A pair expression is written <code>(%%e1%%,%%e2%%)</code>
221 where <code>%%e1%%</code> and <code>%%e2%%</code> are expressions.
222 </p>
223
224 <p>
225 Similarly, pair types and patterns are written
226 <code>(%%t1%%,%%t2%%)</code> where <code>%%t1%%</code> and
227 <code>%%t2%%</code> are types or patterns. E.g.: <code>(Int,Char)</code>.
228 </p>
229
230 <p>
231 When a capture variable <code>%%x%%</code> appears on both
232 side of a pair pattern <code>%%p%% = (%%p1%%,%%p2%%)</code>, the semantics
233 is the following one: when a value match <code>%%p%%</code>,
234 if <code>%%x%%</code> is bound to <code>%%v1%%</code> by
235 <code>%%p1%%</code> and to <code>%%v2%%</code> by
236 <code>%%p2%%</code>,
237 then <code>%%x%%</code> is bound to the pair <code>%%(v1,v2)%%</code> by
238 <code>%%p%%</code>.
239 </p>
240
241 <p>
242 Tuples are syntactic sugar for pairs. For instance,
243 <code>(1,2,3,4)</code> denotes <code>(1,(2,(3,4)))</code>.
244 </p>
245 </box>
246
247 <box title="Sequences" link="seq">
248
249 <section title="Values and expressions">
250
251 <p>
252 Sequences are fundamental in CDuce. They represents
253 the content of XML elements, and also character strings.
254 Actually, they are only syntactic sugar over pairs.
255 </p>
256
257 <p>
258 Sequences expressions are written inside square brackets; element
259 are simply separated by whitespaces:
260 <code>[ %%e1%% %%e2%% %%...%% %%en%% ]</code>.
261 Such an expression is syntactic sugar for:
262 <code>(%%e1%%,(%%e2%%, %%...%% (%%en%%,`nil) %%...%%))</code>.
263 E.g.: <code>[ 1 2 3 4 ]</code>.
264 </p>
265
266 <p>
267 The binary operator <code>@</code> denotes sequence concatenation.
268 E.g.: <code>[ 1 2 3 ] @ [ 4 5 6 ]</code> evaluates to
269 <code>[ 1 2 3 4 5 6 ]</code>.
270 </p>
271
272 <p>
273 It is possible to specify a terminator different from <code>`nil</code>;
274 for instance
275 <code>[ 1 2 3 4 ; %%q%% ]</code> denotes <code>(1,(2,(3,(4,%%q%%))))</code>,
276 and is equivalent to
277 <code>[ 1 2 3 4 ] @ %%q%%</code>.
278 </p>
279
280 <p>
281 Inside the square brackets of a sequence expression, it is possible
282 to have elements of the form <code>! %%e%%</code> (which is not
283 an expression by itself), where <code>%%e%%</code> is an expression
284 which should evaluate to a sequence. The semantics is
285 to "open" <code>%%e%%</code>. For instance:
286 <code>[ 1 2 ![ 3 4 ] 5 ]</code>
287 evaluates to
288 <code>[ 1 2 3 4 5 ]</code>.
289 Consequently, the concatenation of two sequences <code>%%e1%% @ %%e2%%</code>
290 can also be written <code>[ !%%e1%% !%%e2%% ]</code>
291 or <code>[ !%%e1%% ; %%e2%% ]</code>.
292 </p>
293
294 </section>
295
296 <section title="Types and patterns">
297
298 <p>
299 In CDuce, a sequence can be heterogeneous: the element can all have
300 different types. Types and patterns for sequences are specified
301 by regular expressions over types or patterns. The syntax is
302 <code>[ %%R%% ]</code> where <code>%%R%%</code> is a regular expression, which
303 can be:
304 </p>
305 <ul>
306 <li>A type or a pattern, which correspond to a single element in the
307 sequence (in particular, <code>[ _ ]</code> represents
308 sequences of length 1, <em>not</em> arbitrary sequences).</li>
309 <li>A juxtaposition of regular expression <code>%%R1%% %%R2%%</code>
310 which represents concatenation.
311 </li>
312 <li>A postfix repetition operator; the greedy operators are
313 <code>%%R%%?</code>,
314 <code>%%R%%+</code>,
315 <code>%%R%%*</code>, and the ungreedy operators are:
316 <code>%%R%%??</code>,
317 <code>%%R%%+?</code>,
318 <code>%%R%%*?</code>. For types, there is no distinction in semantics between
319 greedy and ungreedy. </li>
320 <li>A sequence capture variable <code>%%x%%::%%R%%</code>
321 (only for patterns, of course).
322 The semantics is to capture in <code>%%x%%</code> the subsequence
323 matched by <code>%%R%%</code>. The same sequence capture variable
324 can appear several times inside a regular expression, including
325 under repetition operators; in that case, all the corresponding
326 subsequences are concatenated together. Two instances of the
327 same sequence capture variable cannot be nested, as in
328 <code>[x :: (1 x :: Int)]</code>.
329 <br/>
330 Note the difference between <code>[ x::Int ]</code> and
331 <code>[ (x &amp; Int) ]</code>. Both accept sequences made of a single
332 integer, but the first one binds <code>x</code> to a sequence
333 (of a single integer), whereas the second one binds it to
334 the integer itself.</li>
335 <li>
336 Grouping <code>(%%R%%)</code>. E.g.: <code>[ x::(Int Int) y ]</code>.
337 </li>
338 <li>
339 Tail predicate <code>/%%p%%</code>. The type/pattern <code>%%p%%</code>
340 applies to the current tail of the sequence (the subsequence
341 starting at the current position). E.g.:
342 <code>[ (Int /(x:=1) | /(x:=2)) _* ]</code> will bind
343 <code>x</code> to <code>1</code> if the sequence starts
344 with an integer and <code>2</code> otherwise.
345 </li>
346 <li>
347 Repetition <code>%%R%% ** %%n%%</code> where <code>%%n%%</code>
348 is a positive integer constant, which is just a shorthand
349 for the concatenation of <code>%%n%%</code> copies of <code>%%R%%</code>.
350 </li>
351 </ul>
352
353 <p>
354 Sequence types and patterns also accepts the <code>[ %%...%%; %%...%% ]</code>
355 notation. This is a convenient way to discard the tail of a sequence
356 in a pattern, e.g.: <code>[ x::Int* ; _ ]</code>, which
357 is equivalent to <code>[ x::Int* _* ]</code>.
358 </p>
359
360 <p>
361 It is possible to use the <code>@</code>
362 operator (sequence concatenation) on types, including in recursive
363 definitions. E.g.:
364 </p>
365
366 <sample><![CDATA[
367 type t = [ <a>(t @ t) ? ] (* [s?] where s=<a>[ s? s? ] *)
368
369 type x = [ Int* ]
370 type y = x @ [ Char* ] (* [ Int* Char* ] *)
371
372 type t = [Int] @ t | [] (* [ Int* ] *)
373 ]]></sample>
374 <p>
375 however when used in recursive definitions <code>@</code> but must be right linear so for instance the following definition are not allowed:
376 </p>
377
378 <sample><![CDATA[
379 type t = t @ [Int] | [] (* ERROR: Ill-formed concatenation loop *)
380 type t = t @ t (* ERROR: Ill-formed concatenation loop *)
381 ]]></sample>
382
383
384 </section>
385
386 </box>
387
388 <box title="Strings" link="string">
389
390 <p>
391 In CDuce, character strings are nothing but sequences of characters.
392 The type <code>String</code> is pre-defined as <code>[ Char* ]</code>.
393 This allows to use the full power of regular expression
394 pattern matching with strings.
395 </p>
396
397 <p>
398 Inside a regular expression type or pattern, it is possible
399 to use <code>PCDATA</code> instead of <code>Char*</code>
400 (note that both are not types on their own, they only make sense
401 inside square brackets, contrary to <code>String</code>).
402 </p>
403
404 <p>
405 The type <code>Latin1</code> is the subtype of <code>String</code>
406 defined as <code>[ Byte* ]</code>; it denotes strings that can
407 be represented in the ISO-8859-1 encoding, that is, strings made only
408 of characters from the Latin1 character set.
409 </p>
410
411 <p>
412 Several consecutive characters literal in a sequence can be
413 merged together between two single quotes:
414 <code>[ 'abc' ]</code> instead of <code>[ 'a' 'b' 'c' ]</code>.
415 Also it is possible to avoid square brackets by using
416 double quotes: <code>"abc"</code>. The same escaping rules applies
417 inside double quotes, except that single quotes may be escaped (but
418 must not), and double quotes must be.
419 </p>
420
421 </box>
422
423 <box title="Records" link="record">
424
425 <p>
426 Records are set of finite (name,value) bindings. They are used
427 in particular to represent XML attribute sets. Names are
428 actually Qualified Names (see <local href="namespaces"/>).
429 </p>
430
431 <p>
432 The syntax of a record expression is
433 <code>{ %%l1%%=%%e1%%; %%...%%; %%ln%%=%%en%% }</code>
434 where the <code>%%li%%</code> are label names (same lexical
435 conventions as for identifiers), and the <code>%%vi%%</code>
436 are expressions. When an expression <code>%%ei%%</code>
437 is simply a variable whose name match the field label
438 <code>%%li%%</code>, it is possible to omit it.
439 E.g.: <code>{ x; y = 10; z }</code>
440 is equivalent to <code>{ x = x; y = 10; z = z }</code>.
441 The semi-colons between fields are optional.
442 </p>
443
444
445
446 <p>
447 They are two kinds of record types. Open record types
448 are written <code>{ %%l1%%=%%t1%%; %%...%%; %%ln%%=%%tn%%; ..
449 }</code>, and closed record types are written
450 <code>{ %%l1%% = %%t1%%; %%...%%; %%ln%% = %%tn%% }</code>.
451 Both denote all the record values where
452 the labels <code>%%li%%</code> are present and the associated values
453 are in the corresponding type. The distinction is that that open
454 type allow extra fields, whereas the closed type gives a strict
455 enumeration of the possible fields. The semi-colon between fields is optional.
456 </p>
457
458 <p>
459 Additionally, both for open and close record types,
460 it is possible to specify optional fields by using <code>=?</code>
461 instead of <code>=</code> between a label and a type.
462 For instance, <code>{ x =? Int; y = Bool }</code>
463 represents records with a <code>y</code> field of type
464 <code>Bool</code>, and an optional field <code>y</code> (that when it is
465 present, has type <code>Int</code>), and no other field.
466 </p>
467
468 <p>
469 The syntax is the same for patterns. Note that capture variables
470 cannot appear in an optional field. A common idiom is to bind
471 default values to replace missing optinal fields: <code>
472 ({ x = a } | (a := 1)) &amp; { y = b }</code>. A special syntax
473 makes this idiom more convenient:
474 <code>{ x = a else (a:=1); y = b }</code>.
475 </p>
476
477 <p>
478 As for record expressions, when the pattern
479 is simply a capture variable whose name match the field label,
480 it is possible to omit it. E.g.: <code>{ x; y = b; z }</code>
481 is equivalent to <code>{ x = x; y = b; z = z }</code>.
482 </p>
483
484 <p>
485 The <code>+</code> operator (record concatenation, with priority given
486 to the right argument in case of overlapping) is available on record
487 types and patterns. This operator can be used to make a close
488 record type/pattern open, or to add fields:
489 </p>
490
491 <sample>
492 type t = { a=Int b=Char }
493 type s = t + {..} (* { a=Int b=Char .. }
494 type u = s + { c=Float } (* { a=Int b=Char c=Float .. } *)
495 type v = t + { c=Float } (* { a=Int b=Char c=Float } *)
496 </sample>
497
498 </box>
499
500 <box title="XML elements" link="xml">
501
502 <p>
503 In CDuce, the general of an XML element is
504 <code>&lt;(%%tag%%) (%%attr%%)>%%content%%</code> where
505 <code>%%tag%%</code>,
506 <code>%%attr%%</code> and
507 <code>%%content%%</code> are three expressions.
508 Usually, <code>%%tag%%</code> is a tag literal <code>`%%xxx%%</code>, and
509 in this case, instead of writing <code>&lt;(`%%tag%%)></code>,
510 you can write: <code>&lt;%%tag%%></code>.
511 Similarly, when <code>%%attr%%</code> is a record literal, you can
512 omit the surrounding <code>({...})</code>, and also the semicolon
513 between attributes,
514 E.g: <code>&lt;a href="http://..." dir="ltr">[]</code>.
515 </p>
516
517 <p>
518 The syntax for XML elements types and patterns follows closely
519 the syntax for expressions:
520 <code>&lt;(%%tag%%) (%%attr%%)>%%content%%</code>
521 where
522 <code>%%tag%%</code>,
523 <code>%%attr%%</code> and
524 <code>%%content%%</code> are three types or patterns.
525 As for expressions, it is possible to simplify the notations
526 for tags and attributes. For instance,
527 <code>&lt;(`a) ({ href=String })>[]</code>
528 can be written:
529 <code>&lt;a href=String>[]</code>.
530 </p>
531
532 <p>
533 The following sample shows several way to write XML types.
534 </p>
535
536 <sample><![CDATA[
537 type A = <a x=String y=String ..>[ A* ]
538 type B = <(`x | `y) ..>[ ]
539 type C = <c x = String; y = String>[ ]
540 type U = { x = String y =? String ..}
541 type V = [ W* ]
542 type W = <v (U)>V
543 ]]></sample>
544
545 </box>
546
547
548 <box title="Functions" link="fun">
549
550 <p>
551 CDuce is an higher-order functional languages: functions are
552 first-class citizen values, and can be passed as argument or returned
553 as result, stored in data structure, etc...
554 </p>
555
556 <p>
557 A functional type has the form <code>%%t%% -> %%s%%</code>
558 where <code>%%t%%</code> and <code>%%s%%</code> are types.
559 Intuitively, this type corresponds to functions that accept
560 (at least) any argument of type <code>%%t%%</code>, and for
561 such an argument, returns a value of type <code>%%s%%</code>.
562 For instance, the type <code>(Int,Int) -> Int &amp; (Char,Char) -> Char</code>
563 denotes functions that maps any pair of integer to an integer,
564 and any pair of characters to a character.
565 </p>
566
567 <p>
568 The explanation above gives the intuition behind the interpretation
569 of functional types. It is sufficient to understand which
570 subtyping relations and equivalences hold between (boolean
571 combination) of functional types. For instance,
572 <code>Int -> Int &amp; Char -> Char</code> is a subtype
573 of <code>(Int|Char) -> (Int|Char)</code> because
574 with the intuition above, a function of the first type,
575 when given a value of type <code>Int|Char</code> returns
576 a value of type <code>Int</code> or of type <code>Char</code>
577 (depending on the argument).
578 </p>
579
580 <p>
581 Formally, the type <code>%%t%% -> %%s%%</code> denotes
582 CDuce abstractions
583 <code>fun (%%t1%% -> %%s1%%; %%...%%; %%tn%% -> %%sn%%)...</code>
584 such that <code>%%t1%% -> %%s1%% &amp; %%...%% &amp; %%tn%% ->
585 %%sn%%</code> is a subtype of <code>%%t%% -> %%s%%</code>.
586 </p>
587
588 <p>
589 Functional types have no counterpart in patterns.
590 </p>
591
592 </box>
593
594 <box title="References" link="ref">
595
596 <p>
597 References are mutable memory cells. CDuce has no built-in
598 reference type. Instead, references are implemented
599 in an object-oriented way. The type <code>ref %%T%%</code>
600 denotes references of values of type <code>%%T%%</code>. It
601 is only syntactic sugar for the type
602 <code>{ get = [] -> T ; set = T -> [] }</code>.
603 </p>
604
605 </box>
606
607 <box title="OCaml abstract types" link="abstr">
608 <p>
609 The notation <code>!t</code> is used by the
610 <local href="manual_interfacewithocaml">CDuce/OCaml interface</local>
611 to denote the OCaml abstract type <code>t</code>.
612 </p>
613 </box>
614
615 <box title="Complete syntax" link="syntax">
616
617 <p>
618 Below we give the complete syntax of type and pattern, the former
619 being patterns without capture variables
620 </p>
621 <p>
622 <b style="color:#FF0080">TO BE DONE</b>
623 </p>
624 </box>
625 </page>

CVS Admin">CVS Admin
ViewVC Help
Powered by ViewVC 1.1.5