From: Mart Lubbers Date: Tue, 6 Jun 2017 10:29:14 +0000 (+0200) Subject: indentation X-Git-Tag: hand-in~96 X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=6a613ef68371fc249a0987b3c5376547e2f386ba;p=msc-thesis1617.git indentation --- diff --git a/results.mtask.tex b/results.mtask.tex index 9580dec..377a8cb 100644 --- a/results.mtask.tex +++ b/results.mtask.tex @@ -38,14 +38,14 @@ accordingly. \begin{lstlisting}[label={lst:bcview},caption={Bytecode view}] :: ByteCode a p = BC (RWS () [BC] BCState ()) :: BCValue = E.e: BCValue e & mTaskType, TC e -:: BCShare = { - sdsi :: Int, - sdsval :: BCValue +:: BCShare = + { sdsi :: Int + , sdsval :: BCValue } -:: BCState = { - freshl :: [Int], - freshs :: [Int], - sdss :: [BCShare] +:: BCState = + { freshl :: [Int] + , freshs :: [Int] + , sdss :: [BCShare] } class toByteCode a :: a -> String @@ -159,17 +159,18 @@ Shared data sources must be acquired from the state and constructing one happens via multiple steps. First a fresh identifier is grabbed from the state. Then a \CI{BCShare} record is created with that identifier. A \CI{BCSdsFetch} instruction is written and the body is generated to finally add the share to -the actual state. The exact implementation is shown in -Listing~\ref{lst:shareview}. +the actual state with the value obtained from the function. The exact +implementation is shown in Listing~\ref{lst:shareview}. \begin{lstlisting}[label={lst:shareview},% caption={Bytecode view for \texttt{arith}}] instance sds ByteCode where sds f = {main = BC (freshs - >>= \sdsi->pure {BCShare | sdsi=sdsi,sdsval=BCValue 0} - >>= \sds->pure (f (tell` [BCSdsFetch sds])) - >>= \(v In bdy)->modify (addSDS sds v) - >>| unBC (unMain bdy))} + >>= \sdsi->pure {BCShare | sdsi=sdsi,sdsval=BCValue 0} + >>= \sds->pure (f (tell` [BCSdsFetch sds])) + >>= \(v In bdy)->modify (addSDS sds v) + >>| unBC (unMain bdy)) + } pub (BC x) = BC (censor (\[BCSdsFetch s]->[BCSdsPublish s]) x) addSDS sds v s = {s & sdss=[{sds & sdsval=BCValue v}:s.sdss]}