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
e02861b7
Commit
e02861b7
authored
Jul 10, 2007
by
Pietro Abate
Browse files
[r2003-07-08 07:47:57 by cvscast] Empty log message
Original author: cvscast Date: 2003-07-08 07:47:57+00:00
parent
bb24ddb7
Changes
1
Hide whitespace changes
Inline
Side-by-side
web/tutorial/overloading.xml
View file @
e02861b7
...
...
@@ -146,9 +146,9 @@ apply <code>split</code> recursively to the elements of <code>mc</code> and <cod
]]>
</sample>
<p>
Here is
the use of overloading: since
<code>
mc
</code>
is of type
<code>
[MPerson*]
</code>
}
, then
the use of overloading: since
<code>
mc
</code>
is of type
<code>
[MPerson*]
</code>
, then
by the overloaded type of
<code>
split
</code>
we can deduce that
<code>
s
</code>
is of type
<code>
[Man*]
</code>
}
; similarly we deduce for
<code>
d
</code>
the type
<code>
[Woman*]
</code>
. From this
<code>
[Man*]
</code>
; similarly we deduce for
<code>
d
</code>
the type
<code>
[Woman*]
</code>
. From this
the type checker deduces that the expressions
<code>
<
sons>s
</code>
and
<code>
<
daughters>
</code>
are of type
<code>
Sons
</code>
and
<code>
Daughters
</code>
, and therefore it
returns for the
<code>
split
</code>
function the type
<code>
(MPerson -> Man)
&
(FPerson
...
...
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