From fe671df9443835d39affe466973489329986244f Mon Sep 17 00:00:00 2001 From: Sergei Winitzki Date: Fri, 29 Mar 2024 19:02:29 +0100 Subject: [PATCH] minor fix (#92) * minor fix * update latex files --- sofp-src/book_cover/sofp-cover-parameters.tex | 2 +- sofp-src/sofp-curry-howard.lyx | 43 +++++++++++-------- sofp-src/sofp-curry-howard.tex | 9 ++-- sofp-src/sofp-disjunctions.tex | 2 +- sofp-src/sofp.tex | 6 +-- 5 files changed, 36 insertions(+), 26 deletions(-) diff --git a/sofp-src/book_cover/sofp-cover-parameters.tex b/sofp-src/book_cover/sofp-cover-parameters.tex index df37b5846..1a454f3d0 100644 --- a/sofp-src/book_cover/sofp-cover-parameters.tex +++ b/sofp-src/book_cover/sofp-cover-parameters.tex @@ -18,7 +18,7 @@ % -- Ingram: page count MUST be divisible by 2. % -- Blurb : page count MUST be divisible by 6. % Add blank pages as needed in final PDF generations! -\pgfmathsetmacro\TotalPageCount{1293}% Must be manually entered +\pgfmathsetmacro\TotalPageCount{TOTALPAGES}% Must be manually entered \pgfmathsetmacro\PaperWidthPt{7.444in}% \pgfmathsetmacro\PaperHeightPt{9.68in}% diff --git a/sofp-src/sofp-curry-howard.lyx b/sofp-src/sofp-curry-howard.lyx index 6ae0119f7..9ae11ecb3 100644 --- a/sofp-src/sofp-curry-howard.lyx +++ b/sofp-src/sofp-curry-howard.lyx @@ -21834,43 +21834,52 @@ The function \begin_inset Formula $f$ \end_inset - cannot use its argument of type -\begin_inset Formula $A$ -\end_inset + must return the fixed value +\begin_inset listings +inline true +status open - since nothing is known about the type -\begin_inset Formula $A$ -\end_inset +\begin_layout Plain Layout + +() +\end_layout -. - So, the code of -\begin_inset Formula $f$ \end_inset - -\emph on -must -\emph default - discard its argument and return the fixed value + of type \begin_inset listings inline true status open \begin_layout Plain Layout -() +Unit \end_layout \end_inset - of type +. + The argument of type +\begin_inset Formula $A$ +\end_inset + + is of no use for that. + So, the code of +\begin_inset Formula $f$ +\end_inset + + +\emph on +must +\emph default + discard its argument and return the value \begin_inset listings inline true status open \begin_layout Plain Layout -Unit +() \end_layout \end_inset diff --git a/sofp-src/sofp-curry-howard.tex b/sofp-src/sofp-curry-howard.tex index dcac6cfcd..c317e74f5 100644 --- a/sofp-src/sofp-curry-howard.tex +++ b/sofp-src/sofp-curry-howard.tex @@ -3159,10 +3159,11 @@ \subsubsection{Example \label{subsec:ch-Example-type-identity-2}\ref{subsec:ch-E \begin{lstlisting} def f[A]: A => Unit = { _ => () } \end{lstlisting} -The function $f$ cannot use its argument of type $A$ since nothing -is known about the type $A$. So, the code of $f$ \emph{must} discard -its argument and return the fixed value \lstinline!()! of type \lstinline!Unit!. -In the code notation, this function is written as: +The function $f$ must return the fixed value \lstinline!()! of type +\lstinline!Unit!. The argument of type $A$ is of no use for that. +So, the code of $f$ \emph{must} discard its argument and return the +value \lstinline!()!. In the code notation, this function is written +as: \[ f^{:A\rightarrow\bbnum 1}\triangleq\_\rightarrow1\quad. \] diff --git a/sofp-src/sofp-disjunctions.tex b/sofp-src/sofp-disjunctions.tex index 8a4a65f59..951fb7e83 100644 --- a/sofp-src/sofp-disjunctions.tex +++ b/sofp-src/sofp-disjunctions.tex @@ -1147,7 +1147,7 @@ \subsubsection{Example \label{subsec:Disjunction-Example-Option-getOrElse}\ref{s may be written as: \begin{lstlisting} sealed trait Either[A, B] -final case class Left[A, B](value: A) extends Either[A, B] +final case class Left[A, B](value: A) extends Either[A, B] final case class Right[A, B](value: B) extends Either[A, B] \end{lstlisting} By convention, a value \lstinline!Left(x)! represents an error, and diff --git a/sofp-src/sofp.tex b/sofp-src/sofp.tex index b03fc5532..f64076b78 100644 --- a/sofp-src/sofp.tex +++ b/sofp-src/sofp.tex @@ -320,9 +320,9 @@ {\footnotesize{}ISBN (e-book): 978-0-359-76877-6}\\ {\footnotesize{}ISBN: 978-0-359-76877-6}\\ \\ -{\scriptsize{}Source hash (sha256): 96d583d77c94d2bde34571964e809e523a86f343dbb7b8c928f44946847ec8d1}\\ -{\scriptsize{}Git commit: a5f7c30bdfaee2a339f4c0df21394d29d83b7279}\\ -{\scriptsize{}PDF file built on Fri, 29 Mar 2024 18:05:57 +0100 by pdfTeX 3.141592653-2.6-1.40.25 (TeX Live 2023) on Darwin}\\ +{\scriptsize{}Source hash (sha256): 95955e7292d5e9d345cf3eabf587f153e515088c3257f8e8f6aba6aa82b6d06e}\\ +{\scriptsize{}Git commit: d15dfa33120f0de2742919a74050a5d1adb88be3}\\ +{\scriptsize{}PDF file built on Fri, 29 Mar 2024 19:01:28 +0100 by pdfTeX 3.141592653-2.6-1.40.25 (TeX Live 2023) on Darwin}\\ ~\\ {\scriptsize{}Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License,