Переглянути джерело

Improve spelling

stripped-german
Julian Ospald 9 роки тому
джерело
коміт
8852f5d465
Не вдалося знайти GPG ключ що відповідає даному підпису Ідентифікатор GPG ключа: 220CD1C5BDEED020
1 змінених файлів з 8 додано та 8 видалено
  1. +8
    -8
      VL1.tex

+ 8
- 8
VL1.tex Переглянути файл

@@ -119,7 +119,7 @@ You need to change only one single line in such a C function. You have to know:
\item does it change the state of static or global variables?
\item does it implicitly change the state of out-parameters?
\item if it changes any of those states, is the function still correct?
\item what happens if the program flow reaches this codepath with variable X in that particular state, while variable Z is NULL, and...
\item what happens if the program flow reaches this code-path with variable X in that particular state, while variable Z is NULL, and...
\item did you just nuke a small former Soviet state?
\end{itemize}
\vspace{\baselineskip}
@@ -140,7 +140,7 @@ Unfortunately, we:
\begin{itemize}[<+->]
\item now got even more states to keep track of (intellectual complexity?)
\item have clouded the program flow... it's now about object-interaction with their explicit and implicit states
\item still have \textbf{side effects} everywhere: one object changes the state of another and vice versa, may arbitrarily write to the hard drive, do kernel calls or launch a missle
\item still have \textbf{side effects} everywhere: one object changes the state of another and vice versa, may arbitrarily write to the hard drive, do kernel calls or launch a missile
\end{itemize}
\onslide<+->
Some parts of the implicit state machine have been made explicit by modelling classes, but it's still there and we have to deal with it, because we are modelling everything around states. Wouldn't it be nice if we could just forget about the global state machine? Maybe there is even a way to remove side effects and have more "predictability"?
@@ -168,7 +168,7 @@ Think of haskell functions as regular \emph{mathematical} functions.
\end{itemize}
\onslide<+->
\vspace{\baselineskip}
It's all about \emph{input} and \emph{ouput} of functions! And that's it. Nothing else to worry about.
It's all about \emph{input} and \emph{output} of functions! And that's it. Nothing else to worry about.
\end{frame}

\begin{frame}
@@ -228,7 +228,7 @@ Let's reiterate. Haskell is:
\item functional
\item pure
\item lazy
\item statically typed (and truly typesafe)
\item statically typed (and truly type-safe)
\item even garbage collected
\item the world's finest imperative language (what??)
\end{itemize}
@@ -338,7 +338,7 @@ mod2 x
| x - 2 < 0 = x
| otherwise = mod2 (x - 2)
\end{lstlisting}
These \verb#|# things above are called \textbf{guards} and are similar to \emph{pattern matching}. They are processed in order. If the condition on the left side of the equation is true, then it returns what stands on the right side of the equation. If it's false, then it processes the next line.\\ \code{otherwise} on the last line is just defined as \code{True}, to make these constructs reasier to read and catch all other cases of input.
These \verb#|# things above are called \textbf{guards} and are similar to \emph{pattern matching}. They are processed in order. If the condition on the left side of the equation is true, then it returns what stands on the right side of the equation. If it's false, then it processes the next line.\\ \code{otherwise} on the last line is just defined as \code{True}, to make these constructs easier to read and catch all other cases of input.
\end{frame}

\begin{frame}[fragile]
@@ -461,7 +461,7 @@ Of course we can also define our own data types in haskell. One very common type
data WeekDay = Monday
| Tuesday
| Thursday
| Wednsday
| Wednesday
| Friday
| Saturday
| Sunday
@@ -474,14 +474,14 @@ We could now define a whole week, by creating a list:
\setHaskellCodeStyle
\begin{lstlisting}
week :: [WeekDay]
week = [Monday, Tuesday, Thursday, Wednsday
week = [Monday, Tuesday, Thursday, Wednesday
, Friday, Saturday, Sunday]
\end{lstlisting}
\end{frame}

\begin{frame}[fragile]
\frametitle{Algebraic Data Types (ctn.)}
And we can again \emph{pattern match} on our \code{WeekDay} type. Let's find out if a given day is a monday:
And we can again \emph{pattern match} on our \code{WeekDay} type. Let's find out if a given day is a Monday:
\pause
\setHaskellCodeStyle
\begin{lstlisting}


Завантаження…
Відмінити
Зберегти