haskell-lectures/VL1/content/VL1_what_does_pure_mean.tex

19 lines
663 B
TeX
Raw Normal View History

\emph{Referential transparency}, as in:
\slidep
\begin{itemizep}
\item everything (variables, data structures...) is \emph{immutable}
\item expressions never have side-effects (remember: mathematical functions)
\item same input $\mapsto$ same output... \emph{always}!
\item replace a function with it's (return) value? Yes. What happens in C or java if you do that? Remember \cppinline{void pop();}?
\end{itemizep}
\slidep
\vspace{\baselineskip}
possible benefits?
\begin{itemizep}
\item parallelism
\item equational reasoning and refactoring
\item less bugs!
\end{itemizep}
\slidep
\vspace{\baselineskip}
Question: call-by-value? call-by-reference? call-by-need?