Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
winitzki committed Jan 26, 2024
1 parent f23c397 commit f955603
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion sofp-src/book_cover/sofp-cover-parameters.tex
Expand Up @@ -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{TOTALPAGES}% Must be manually entered
\pgfmathsetmacro\TotalPageCount{1235}% Must be manually entered
\pgfmathsetmacro\PaperWidthPt{7.444in}%
\pgfmathsetmacro\PaperHeightPt{9.68in}%

Expand Down
2 changes: 1 addition & 1 deletion sofp-src/sofp-essay2.lyx
Expand Up @@ -2024,7 +2024,7 @@ status open
\begin_inset Caption Standard

\begin_layout Plain Layout
A programmer performs a derivation before writing Haskell code.
An imaginary programmer performs a derivation before writing Haskell code.
\begin_inset CommandInset label
LatexCommand label
name "fig:Example-calculation-in-type-theory"
Expand Down
15 changes: 7 additions & 8 deletions sofp-src/sofp-traversable.tex
Expand Up @@ -1844,10 +1844,10 @@ \subsubsection{Exercise \label{subsec:Exercise-traversables-7}\ref{subsec:Exerci
For the binary tree \lstinline!T2[A]! (Section~\ref{subsec:Recursion-schemes.-folding}),
implement a \lstinline!Traversable! instance for \emph{right-to-left}
depth-first traversal order. Use that to implement \lstinline!zipWithIndex!
for the type \lstinline!T2[A]!. Verify that \lstinline!zipWithIndex!
transforms the tree {\tiny{} \Tree[ [ 8 [ 3 5 ] ] 4 ] } into {\tiny{} \Tree[ [ (8,3) [ (3,2) (5,1) ] ] (4,0) ] }
.
depth-first traversal order. Use that \lstinline!Traversable! instance
to implement \lstinline!zipWithIndex! for the type \lstinline!T2[A]!.
Verify that \lstinline!zipWithIndex! transforms the tree {\tiny{} \Tree[ [ 8 [ 3 5 ] ] 4 ] }
into {\tiny{} \Tree[ [ (8,3) [ (3,2) (5,1) ] ] (4,0) ] } .
\subsubsection{Exercise \label{subsec:Exercise-traversables-8}\ref{subsec:Exercise-traversables-8}}
Expand Down Expand Up @@ -1981,15 +1981,14 @@ \subsubsection{Definition \label{subsec:Definition-monoid-morphism}\ref{subsec:D
The \textbf{monoidal naturality law} \index{monoidal naturality law}of
\lstinline!reduceE! is then formulated as:
\begin{equation}
\text{reduceE}^{M}\bef f^{:M\rightarrow N}=f^{\uparrow L}\bef\text{reduceE}^{N}\quad.\label{eq:monoidal-naturality-law-of-reduceE}
\end{equation}
\[
\xymatrix{\xyScaleY{1.4pc}\xyScaleX{3.5pc}L^{M}\ar[r]\sp(0.5){\ \text{reduceE}^{M}}\ar[d]\sp(0.45){\,f^{\uparrow L}} & M\ar[d]\sp(0.45){\,f}\\
L^{N}\ar[r]\sp(0.5){~\text{reduceE}^{N}} & N
}
\]
\begin{equation}
\text{reduceE}^{M}\bef f^{:M\rightarrow N}=f^{\uparrow L}\bef\text{reduceE}^{N}\quad.\label{eq:monoidal-naturality-law-of-reduceE}
\end{equation}
Here the types $M$, $N$ are arbitrary monoids and $f:M\rightarrow N$
is an arbitrary monoid morphism between $M$ and $N$.
Expand Down
6 changes: 3 additions & 3 deletions sofp-src/sofp.tex
Expand Up @@ -320,9 +320,9 @@
{\footnotesize{}ISBN (e-book): 978-0-359-76877-6}\\
{\footnotesize{}ISBN: 978-0-359-76877-6}\\
\\
{\scriptsize{}Source hash (sha256): 3c45ab56c2c3650f8698f220383b662ee6e806c37e65cd59b239e959895d50e5}\\
{\scriptsize{}Git commit: 63d39f9ed35dda029870f71207f741464e2c87cf}\\
{\scriptsize{}PDF file built by pdfTeX 3.141592653-2.6-1.40.25 (TeX Live 2023) on Mon, 22 Jan 2024 20:38:49 +0100 by Darwin 22.6.0}\\
{\scriptsize{}Source hash (sha256): 7f943ef5d41edc5f95b917eef1405a6a4e5a506f491d2200791e2bbbeeb0dbba}\\
{\scriptsize{}Git commit: f23c397141307f32ce60141128eb44473336f4d4}\\
{\scriptsize{}PDF file built by pdfTeX 3.141592653-2.6-1.40.25 (TeX Live 2023) on Fri, 26 Jan 2024 23:39:13 +0100 by Darwin 22.6.0}\\
~\\
{\scriptsize{}Permission is granted to copy, distribute and/or modify
this document under the terms of the GNU Free Documentation License,
Expand Down

0 comments on commit f955603

Please sign in to comment.