+\begin{frame}[fragile]
+ \frametitle{Mutual Recursion}
+ \begin{itemize}
+ \item Mutual recursion is allowed and type checked, however inference is
+ not complete.
+ \pause
+ \begin{CleanCode}
+flip(n, l) :: Int -> [Int] -> [Int] {
+ if( n <= 0 ) {return l;}
+ else {return flop(n-1, 0:l);}
+}
+
+flop(n, l) :: Int -> [Int] -> [Int] {
+ return flip(n, 1:l);
+}
+ \end{CleanCode}
+ \pause
+ \item Completely typed specifications are checked correctly.
+ \end{itemize}
+\end{frame}
+
+\begin{frame}[fragile]
+ \frametitle{Mutual Recursion}
+ \begin{itemize}
+ \item Mutual recursion is allowed and type checked, however inference is
+ not complete.
+ \begin{CleanCode}
+flip(n, l) :: Int -> [Int] -> [Int] {
+ if( n <= 0 ) {return l;}
+ else {return flop(n-1, 0:l);}
+}
+
+flop(n, l) :: Int -> [Int] -> Bool {
+ return flip(n, 1:l);
+}
+ \end{CleanCode}
+ \pause
+ \item It is also correctly determined that \texttt{Bool} and the return
+ type of \texttt{flop(n,l)} don't match.
+ \end{itemize}
+\end{frame}
+
+\begin{frame}[fragile]
+ \frametitle{Mutual Recursion}
+ \begin{itemize}
+ \item Mutual recursion is allowed and type checked, however inference is
+ not complete.
+ \pause
+ \begin{CleanCode}
+flip(n, l) {
+ if( n <= 0 ) {return l;}
+ else {return flop(n-1, 0:l);}
+}
+
+flop(n, l) {
+ return flip(n, 1:l);
+}
+ \end{CleanCode}
+ \end{itemize}
+\end{frame}
+
+
+\begin{frame}[fragile]
+ \frametitle{Mutual Recursion}
+ \begin{itemize}
+ \item Mutual recursion is allowed and type checked, however inference is
+ not complete.
+ \begin{CleanCode}
+flip(n, l) :: Int -> [Int] -> vTqhp {
+ if( n <= 0 ) {return l;}
+ else {return flop(n-1, 0:l);}
+}
+
+flop(n, l) :: Int -> [Int] -> HSWdn {
+ return flip(n, 1:l);
+}
+ \end{CleanCode}
+ \item However when no type information is given at all our algorithm
+ fails to correctly infer the result type of the two function.
+ \end{itemize}
+\end{frame}
+