-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfast-and-loose-reasoning.tex
51 lines (47 loc) · 1.31 KB
/
fast-and-loose-reasoning.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
\begin{frame}
\frametitle{What is Parametricity}
\begin{block}{Danielsson, Hughes, Jansson \& Gibbons \cite{danielsson2006fast} tell us:}
\begin{quotation}
Functional programmers often reason about programs as if
they were written in a total language, expecting the results
to carry over to non-total (partial) languages. We justify
such reasoning.
\end{quotation}
\end{block}
\end{frame}
\begin{frame}[fragile]
\frametitle{Fast and Loose Reasoning}
\begin{lstlisting}
boolean even(int i) =
...
\end{lstlisting}
We casually say, ``This function returns one of two things.''
\end{frame}
\begin{frame}[fragile]
\frametitle{Fast and Loose Reasoning}
\begin{lstlisting}
boolean even(int i) =
even(i)
\end{lstlisting}
and we can discard this third possibility in our reasoning.
\end{frame}
\begin{frame}[fragile]
\frametitle{Fast and Loose Reasoning}
\begin{center}
We are \emph{fast and loose reasoning}.
\end{center}
\end{frame}
\begin{frame}[fragile]
\frametitle{Fast and Loose Reasoning}
\begin{block}{many programming environments involve some, or all of}
\begin{itemize}
\item \lstinline{null}
\item exceptions
\item Type-casing
\item Type-casting
\item Side-effects
\item universal \lstinline{equals}/\lstinline{toString}
\end{itemize}
\end{block}
For similar reasons, these can all be \emph{morally} discarded.
\end{frame}