From: pimjager Date: Thu, 14 Apr 2016 09:24:05 +0000 (+0200) Subject: Merge branch 'master' of https://github.com/dopefishh/cc1516 X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=3d569407ede8e77c5809a1076735dc3c58ab1922;hp=2c6cd7dda8fd06c4457efc8751df343b83616b11;p=cc1516.git Merge branch 'master' of https://github.com/dopefishh/cc1516 --- diff --git a/deliverables/p2/p2.tex b/deliverables/p2/p2.tex index 09d75d2..a3fca20 100644 --- a/deliverables/p2/p2.tex +++ b/deliverables/p2/p2.tex @@ -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?