Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
5eac8b00
Commit
5eac8b00
authored
Oct 05, 2007
by
Pietro Abate
Browse files
[r2004-07-03 09:03:26 by afrisch] Manual
Original author: afrisch Date: 2004-07-03 09:03:26+00:00
parent
f2e5b194
Changes
1
Show whitespace changes
Inline
Side-by-side
web/manual/types_patterns.xml
View file @
5eac8b00
...
...
@@ -304,18 +304,24 @@ which represents concatenation.
<code>
%%R%%+?
</code>
,
<code>
%%R%%*?
</code>
. For types, there is no distinction in semantics between
greedy and ungreedy.
</li>
<li>
A sequence capture variable
<code>
%%x%%::%%R%%
</code>
.
<li>
A sequence capture variable
<code>
%%x%%::%%R%%
</code>
(only for patterns, of course).
The semantics is to capture in
<code>
%%x%%
</code>
the subsequence
matched by
<code>
%%R%%
</code>
. The same sequence capture variable
can appear several times inside a regular expression, including
under repetition operators; in that case, all the corresponding
subsequences are concatenated together.
subsequences are concatenated together. Two instances of the
same sequence capture variable cannot be nested, as in
<code>
[x :: (1 x :: Int)]
</code>
.
<br/>
Note the difference between
<code>
[ x::Int ]
</code>
and
<code>
[ (x
&
Int) ]
</code>
. Both accept sequences made of a single
integer, but the first one binds
<code>
x
</code>
to a sequence
(of a single integer), whereas the second one binds it to
the integer itself.
</li>
<li>
Grouping
<code>
(%%R%%)
</code>
. E.g.:
<code>
[ x::(Int Int) y ]
</code>
.
</li>
</ul>
<p>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment