1
0
mirror of https://github.com/dhil/phd-dissertation synced 2026-03-13 02:58:26 +00:00

fix typos

This commit is contained in:
2021-05-21 18:51:24 +01:00
parent eefa6e4ad4
commit c254d293a9

View File

@@ -600,7 +600,7 @@ to manipulate the contents of some global state cell $st$.
\[ \[
\bl \bl
\incrEven : \UnitType \to \Bool\\ \incrEven : \UnitType \to \Bool\\
\incrEven\,\Unit \defas \Let\;v \revto !st\;\In\;st \defnas 1 + v;\,\even~st \incrEven\,\Unit \defas \Let\;v \revto !st\;\In\;st \defnas 1 + v;\,\even~v
\el \el
\] \]
% %
@@ -993,7 +993,7 @@ follows.
\bl \bl
T~A \defas \Int \to (A \times \Int)\smallskip\\ T~A \defas \Int \to (A \times \Int)\smallskip\\
\incrEven : \UnitType \to T~\Bool\\ \incrEven : \UnitType \to T~\Bool\\
\incrEven~\Unit \defas \getF \incrEven~\Unit \defas \getF\,\Unit
\bind (\lambda st. \bind (\lambda st.
\putF\,(1+st) \putF\,(1+st)
\bind \lambda\Unit. \Return\;(\even~st))) \bind \lambda\Unit. \Return\;(\even~st)))
@@ -1364,10 +1364,10 @@ Monadic reflection is a technique due to
delimited control to perform a local switch from monadic style into delimited control to perform a local switch from monadic style into
direct-style and vice versa. The key insight is that a control reifier direct-style and vice versa. The key insight is that a control reifier
provides an escape hatch that makes it possible for computation to provides an escape hatch that makes it possible for computation to
locally unseal the monad, as it were. The scope of this escape hatch locally jump out of the monad, as it were. The scope of this escape
is restricted by the control delimiter, which seals computation back hatch is restricted by the control delimiter, which forces computation
into the monad. Monadic reflection introduces two operators, which are back into the monad. Monadic reflection introduces two operators,
defined over some monad $T$ and some fixed result type $R$. which are defined over some monad $T$ and some fixed result type $R$.
% %
\[ \[
\ba{@{~}l@{\qquad\quad}@{~}r} \ba{@{~}l@{\qquad\quad}@{~}r}
@@ -1386,17 +1386,18 @@ defined over some monad $T$ and some fixed result type $R$.
\] \]
% %
The first operator $\reify$ (pronounced `reify') performs The first operator $\reify$ (pronounced `reify') performs
\emph{monadic unsealing}, which means it makes the effect \emph{monadic reification}. Semantically it makes the effect
corresponding to $T$ in the thunk $m$ transparent. The implementation corresponding to $T$ transparent. The implementation installs a reset
installs a reset instance to delimit control effects of $m$. The instance to delimit control effects of $m$. The result of forcing $m$
result of forcing $m$ gets lifted into the monad $T$. gets lifted into the monad $T$.
% %
The second operator $\reflect$ (pronounced `reflect') performs The second operator $\reflect$ (pronounced `reflect') performs
\emph{monadic sealing}. It makes the effect corresponding to $T$ in \emph{monadic reflection}. It makes the effect corresponding to $T$
its parameter $m$ opaque. The implementation applies $\shift$ to opaque. The implementation applies $\shift$ to capture the current
capture the current continuation (up to the nearest instance of continuation (up to the nearest instance of reset). Subsequently, it
reset). Subsequently, it evaluates the monadic computation $m$ and evaluates the monadic computation $m$ and passes the result of this
passes the result of this evaluation to the continuation $k$. evaluation to the continuation $k$, which effectively performs the
jump out of the monad.
Suppose we instantiate $T = \State~S$ for some type $S$, then we can Suppose we instantiate $T = \State~S$ for some type $S$, then we can
@@ -1434,7 +1435,7 @@ defined in terms of the state monad runner.
\[ \[
\bl \bl
\runState : (\UnitType \to R) \to S \to R \times S\\ \runState : (\UnitType \to R) \to S \to R \times S\\
\runState~m~st_0 \defas T.\runState~(\reify m)~st_0 \runState~m~st_0 \defas T.\runState~(\lambda\Unit.\reify m)~st_0
\el \el
\] \]
% %