Commits

Tony Morris  committed c12ec34

results of proof-read

  • Participants
  • Parent commits 107a583

Comments (0)

Files changed (2)

File asymmetriclenses.tex

 \subsection{Exploiting Lens Composition}
 \label{subsect:exploitingcomposition}
 
-An example of exploiting the composition of lenses is to produce the lens for the street of a person's address\footnote {Recall that a person has an address and an address has a street.}. We may first take the address lens, which has the type \lstinline$Lens[Person, Address]$. We then take the street lens, which has the type \lstinline$Lens[Address, String]$ and we can produce a lens with the type \lstinline$Lens[Person, String]$ by exploiting composition:
+An example of exploiting the composition of lenses is to produce the lens for
+the street of a person's address\footnote {Recall that a person has an address
+and an address has a street.}. We may first take the address lens, which has the
+type \lstinline$Lens[Person, Address]$. We then take the street lens, which has the type \lstinline$Lens[Address, String]$ and we can produce a lens with the type \lstinline$Lens[Person, String]$ by exploiting composition:
 
 \begin{lstlisting}[label=lst:Lens_composition,caption=Lenses under composition,language=Scala]
 def addressL: Lens[Person, Address] = ...

File lenslibraries.tex

 \item numeric values \textemdash performing numeric operations.
 \end{itemize}
 
-\subsection{Lens Produces State}
-\label{subsect:lensstate}
-
-A lens gives rise to a trivial \lstinline$State$ instance by 
-\begin{lstlisting}[label=lst:Lens_State,language=Scala]
-l => State(s => (l get s, s))
-\end{lstlisting}
-Since \lstinline$State$ forms a monad, this gives rise to other useful programming constructs, such as emulating imperative programming (\ref{emulatingimperativeprogramming}).
-
 \subsection{Infix Type Alias}
 \label{infixTypeAlias}
 
 
 Indeed, the signature is the type of composition under a category, where that category is \lstinline$@>$ denoting the lens category in this instance and the \lstinline$=>$ category in the case of function composition.
 
+\subsection{Lens Produces State}
+\label{subsect:lensstate}
+
+A lens gives rise to a trivial \lstinline$State$ instance by 
+\begin{lstlisting}[label=lst:Lens_State,language=Scala]
+l => State(s => (l get s, s))
+\end{lstlisting}
+Since \lstinline$State$ forms a monad, this gives rise to other useful programming constructs, such as emulating imperative programming (\ref{emulatingimperativeprogramming}).
+
 \subsection{Emulating Imperative Programming}
 \label{emulatingimperativeprogramming}