From b87fa9a0489ec25a07b52bd98c3b265e06903ebb Mon Sep 17 00:00:00 2001 From: JanUlrich Date: Wed, 14 Feb 2024 15:44:46 +0100 Subject: [PATCH] intro comment --- introduction.tex | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/introduction.tex b/introduction.tex index cf39cc1..40ce1d5 100644 --- a/introduction.tex +++ b/introduction.tex @@ -172,6 +172,33 @@ m(l) { $\tv{l} \lessdotCC \exptype{List}{\wtv{x}}, \tv{l} \lessdotCC \wtv{x}$ +% One possible solution: +% \begin{verbatim} +% List m(List l) { +% return l.add(l); +% } +% \end{verbatim} + +% No capture conversion for methods in the same class: +% \begin{verbatim} +% m() = new List() :? new List(); +% id(a) = a + +% id(m()) +% \end{verbatim} +% id will get type List -> List +% % explain polymorphic recursion here +% % no capture conversion needed + +% The id method is pre typed: +% \begin{verbatim} +% List id(List a) = a + +% m() = new List() :? new List() :? id(m()); +% \end{verbatim} +% constraint m :: p -> r +% % Wildcards are only deleted in unify, never generated. + \subsection{Java Wildcards} Wildcards are expressed by a \texttt{?} in Java and can be used as parameter types. Wildcards can be formalized as existential types \cite{WildFJ}.