Tony Morris committed 4c37c7f

reset \newpage

Comments (0)

Files changed (1)


 \lstinputlisting[label=lst:Lens_imperative,caption=Lenses with methods for imperative programming]{source/LensImperative.scala}
 Next, we examine some combinators on \lstinline$State$, which will be useful for our use-case:
 \item \lstinline$get$ which gets the current state value into the non-state value of \lstinline$State$. That is, it duplicates the state value with \lstinline$s => (s, s)$.
 Finally, we demonstrate the use-case by:
-\item updating an employee's salary by 100
+\item updating an employee's salary by \lstinline$100$
 \item updating an employee's name by appending a surname \lstinline$" Jones"$
 We do this by keeping these modifications inside a state value, which is constructed by composing smaller state values with its monad. The final modification is kept in a value, which may then be applied to any \lstinline$Employee$ instance.
 \begin{lstlisting}[label=lst:ImperativeProgramming,caption=Imperative programming with lenses and state,language=Scala]
 val modification =
   for {