Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fixes for 1.6 #347

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/content/1.6/simple-algebraic-data-types.tex
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ \section{Product Types}
\code{String} and \code{Bool}:

\src{snippet10}
The first line is the type declaration. It uses the type constructor
The first line is the type signature. It uses the type constructor
\code{Pair}, with \code{String} and \code{Bool} replacing
\code{a} and the \code{b} in the generic definition of
\code{Pair}. The second line defines the actual value by passing a
Expand Down Expand Up @@ -254,7 +254,7 @@ \section{Sum Types}

\begin{snip}{cpp}
template<class A>
class List {
class List {
Node<A> * _head;
public:
List() : _head(nullptr) {} // Nil
Expand Down Expand Up @@ -357,7 +357,7 @@ \section{Algebra of Types}
and here's one that goes the other way:

\src{snippet35}
The \code{case of} statement is used for pattern matching inside
The \code{case of} clause is used for pattern matching inside
functions. Each pattern is followed by an arrow and the expression to be
evaluated when the pattern matches. For instance, if you call
\code{prodToSum} with the value:
Expand Down Expand Up @@ -390,10 +390,10 @@ \section{Algebra of Types}
\endhead
$0$ & \code{Void}\tabularnewline
$1$ & \code{()}\tabularnewline
$a + b$ & \code{Either a b = Left a | Right b}\tabularnewline
$a \times b$ & \code{(a, b)} or \code{Pair a b = Pair a b}\tabularnewline
$a + b$ & \code{data Either a b = Left a | Right b}\tabularnewline
$a \times b$ & \code{(a, b)} or \code{data Pair a b = Pair a b}\tabularnewline
$2 = 1 + 1$ & \code{data Bool = True | False}\tabularnewline
$1 + a$ & \code{data Maybe = Nothing | Just a}\tabularnewline
$1 + a$ & \code{data Maybe a = Nothing | Just a}\tabularnewline
\bottomrule
\end{longtable}

Expand Down Expand Up @@ -451,7 +451,7 @@ \section{Algebra of Types}
\endhead
$\mathit{false}$ & \code{Void}\tabularnewline
$\mathit{true}$ & \code{()}\tabularnewline
$a \mathbin{||} b$ & \code{Either a b = Left a | Right b}\tabularnewline
$a \mathbin{||} b$ & \code{data Either a b = Left a | Right b}\tabularnewline
$a \mathbin{\&\&} b$ & \code{(a, b)}\tabularnewline
\bottomrule
\end{longtable}
Expand All @@ -472,7 +472,7 @@ \section{Challenges}
Here's a sum type defined in Haskell:

\begin{snip}{haskell}
data Shape = Circle Float
data Shape = Circle Float
| Rect Float Float
\end{snip}
When we want to define a function like \code{area} that acts on a
Expand Down
2 changes: 1 addition & 1 deletion src/content/1.9/function-types.tex
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ \subsection{Exponentials of Sums}
that a function from a sum of two types is equivalent to a pair of
functions from individual types. This is just the case analysis that we
use when defining functions on sums. Instead of writing one function
definition with a \code{case} statement, we usually split it into two
definition with a \code{case} clause, we usually split it into two
(or more) functions dealing with each type constructor separately. For
instance, take a function from the sum type
\code{(Either Int Double)}:
Expand Down
2 changes: 1 addition & 1 deletion src/content/2.2/limits-and-colimits.tex
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ \section{Continuity}

\src{snippet18}
Indeed, any function of \code{Either b c} is implemented as a case
statement with the two cases being serviced by a pair of functions.
clause with the two cases being serviced by a pair of functions.

Similarly, when we fix the first argument of the hom-set, we get the
familiar reader functor. Its continuity means that, for instance, any
Expand Down
2 changes: 1 addition & 1 deletion src/content/3.10/ends-and-coends.tex
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ \section{Coends}
function must be prepared to handle any one of the types that may be
encoded in the existential type. It's the same principle that tells us
that a function that accepts a sum type must be implemented as a case
statement, with a tuple of handlers, one for every type present in the
clause, with a tuple of handlers, one for every type present in the
sum. Here, the sum type is replaced by a coend, and a family of handlers
becomes an end, or a polymorphic function.

Expand Down