浏览代码

Improve polymorphism slides

master
Julian Ospald 9 年前
父节点
当前提交
fe69947378
找不到此签名对应的密钥 GPG 密钥 ID: 220CD1C5BDEED020
共有 3 个文件被更改,包括 10 次插入9 次删除
  1. +1
    -0
      VL2/VL2_document_structure.tex
  2. +1
    -9
      VL2/content/VL2_polymorphism2.tex
  3. +8
    -0
      VL2/content/VL2_polymorphism3.tex

+ 1
- 0
VL2/VL2_document_structure.tex 查看文件

@@ -11,6 +11,7 @@

\slide{./content/VL2_polymorphism1.tex}
\slide{./content/VL2_polymorphism2.tex}[ (cnt.)]
\slide{./content/VL2_polymorphism3.tex}[ (cnt.)]


\section{\ifger{Andere Arten der Funktionsdefinition}{More ways to define functions}}


+ 1
- 9
VL2/content/VL2_polymorphism2.tex 查看文件

@@ -9,12 +9,4 @@ isListEmpty x = False
\begin{haskellcode}
f :: a -> b
\end{haskellcode}
\ifger{D.h. was auch immer diese Funktion macht, sie bekommt etwas von einem Typ rein und gibt etwas von einem anderen Typ aus. \hinline{a} und \hinline{b} könnten vom selben Typ sein, müssen aber nicht! D.h. Funktionen dieser Art geben uns häufig mehr Freiheit. Mehr können wir über diese Funktion nicht sagen.}{So, whatever the function does... it gets something of one type and returns something of another type. \hinline{b} \emph{could} be the same type as \hinline{a} here, but it doesn't need to, so functions of this type often give us more freedom! That's all we know about this function.}
\vspace{\baselineskip}
\\
\pause
\ifger{Erinnern wir uns an die Funktion \hinline{head}. Wir können auf jeder Art von Liste mit ihr operieren. Die Typsignatur:}{Similarly, remember the function \hinline{head} which gives us the first element of a list? The type signature actually looks like this:}
\begin{haskellcode}
head :: [a] -> a
\end{haskellcode}
\ifger{Macht Sinn?}{Makes sense?}
\ifger{D.h. was auch immer diese Funktion macht, sie bekommt etwas von einem Typ rein und gibt etwas von einem anderen Typ aus. \hinline{a} und \hinline{b} könnten vom selben Typ sein, müssen aber nicht! D.h. Funktionen dieser Art geben uns häufig mehr Freiheit. Mehr können wir über diese Funktion nicht sagen.}{So, whatever the function does... it gets something of one type and returns something of another type. \hinline{b} \emph{could} be the same type as \hinline{a} here, but it doesn't need to, so functions of this type often give us more freedom! That's all we know about this function.}

+ 8
- 0
VL2/content/VL2_polymorphism3.tex 查看文件

@@ -0,0 +1,8 @@
\ifger{Erinnern wir uns an die Funktion \hinline{head}. Wir können auf jeder Art von Liste mit ihr operieren. Die Typsignatur:}{Similarly, remember the function \hinline{head} which gives us the first element of a list? The type signature actually looks like this:}
\begin{haskellcode}
head :: [a] -> a
\end{haskellcode}
\ifger{Macht Sinn?}{Makes sense?}
\vspace{\baselineskip}\\
\pause
\ifger{Frage: könnte \hinline{a} eine Funktion sein?}{Question: could \hinline{a} be a function?}

正在加载...
取消
保存