Merge branch 'master' of https://github.com/dopefishh/cc1516
authorpimjager <pim@pimjager.nl>
Thu, 14 Apr 2016 09:24:05 +0000 (11:24 +0200)
committerpimjager <pim@pimjager.nl>
Thu, 14 Apr 2016 09:24:05 +0000 (11:24 +0200)
deliverables/p2/p2.tex

index 09d75d2..a3fca20 100644 (file)
@@ -130,7 +130,6 @@ flop(n, l) :: Int -> [Int] -> Bool {
        \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;} 
@@ -165,6 +164,36 @@ flop(n, l) :: Int -> [Int] -> HSWdn {
        \end{itemize}
 \end{frame}
 
+\begin{frame}[fragile]
+       \frametitle{But wait, there is more!}
+       \framesubtitle{Trouble that is}
+       \begin{itemize}
+               \item Polymorphism is not working great either.
+               \begin{CleanCode}
+id(x) :: a -> a {
+    return x;    
+}
+               \end{CleanCode}
+               \pause
+               \item Is typed fun, but when we introduce: 
+               \begin{CleanCode}
+var x = id(5);
+var y = id(True);
+               \end{CleanCode}
+               \pause
+               \begin{CleanCode}
+2:12 SemError: Cannot unify types. Expected: Int. Given: Bool
+               \end{CleanCode}
+       \end{itemize}
+\end{frame}
+
+\begin{frame}[fragile]
+       \frametitle{But wait, there is more!}
+       \framesubtitle{Trouble that is}
+       
+       \begin
+\end{frame}
+
 % - Can functions that are defined later in a file call earlier defined functions?
 % - Can local variables be defined in terms of other local variables?
 % - How do you deal with assignments?