VL1: translate into german

This commit is contained in:
Julian Ospald
2015-04-23 22:40:13 +02:00
parent de46c5c18c
commit 19abcc037e
44 changed files with 215 additions and 210 deletions

View File

@@ -1,4 +1,4 @@
And now we can do sanity checks:
\ifger{Und jetzt können wir Sicherheitsabfragen machen:}{And now we can do sanity checks:}
\begin{haskellcode}
calcSomething :: Int -> MaybeInt
calcSomething x
@@ -6,10 +6,10 @@ calcSomething x
| otherwise = Error "Int out of range!"
\end{haskellcode}
\pause
And pattern match on it as well:
\ifger{Und darauf \emph{pattern matchen}}{And pattern match on it as well}:
\begin{haskellcode}
addIntToList :: MaybeInt -> [Int]
addIntToList (NoError x) = [x]
addIntToList (Error str) = []
\end{haskellcode}
So if we got an error, we just return an empty list, otherwise we return a list with the \hinline{Int} as its only element.
\ifger{D.h. wenn wir hier einen Error bekommen, geben wir einfach eine leere Liste zurück. Ansonsten geben wir die Liste mit dem \hinline{Int} als einziges Element zurück.}{So if we got an error, we just return an empty list, otherwise we return a list with the \hinline{Int} as its only element.}