- Timestamp:
- Nov 23, 2007, 6:42:23 PM (18 years ago)
- Author:
- neil.c.c.brown
- Message:
-
Tweaked some more code formatting, added a type to the >>* operator (so it is clearer what it does) and tried to be clever with a slide title.
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
docs/trunk/200711-tock-seminars/200711-tock-slides.tex
r37 r38 817 817 \item Operators combine productions into bigger productions 818 818 \begin{itemize} 819 \item \lstinline$<|> :: Parser a -> Parser a -> Parser a (削除) $ -- choice (削除ここまで)819 \item \lstinline$<|> :: Parser a -> Parser a -> Parser a(追記) -- choice$ (追記ここまで) 820 820 \end{itemize} 821 821 \end{itemize} … … 951 951 \frametitle{Testing backend code} 952 952 \begin{lstlisting} 953 type GenOps = GenOps { ... 954 genWhile :: GenOps -> Expression -> Statement -> CodeGenM (), 955 genExpression :: GenOps -> Expression -> CodeGenM (), 956 genStatement :: GenOps -> Statement -> CodeGenM (), 957 ... 958 } 953 -- genWhile :: GenOps -> Expression -> Statement -> CodeGenM () 954 -- genExpression :: GenOps -> Expression -> CodeGenM () 955 -- genStatement :: GenOps -> Statement -> CodeGenM () 959 956 960 957 testgenWhile 961 958 = assertEqual "testgenWhile" 962 "while(@@@) (削除) $$$ (削除ここまで)"959 "while(@@@)(追記) ### (追記ここまで)" 963 960 (runCodeGen (genWhileC whileOps undefined undefined)) 964 961 where 965 962 whileOps = GenOps { genExpression = (\_ _ -> tell ["@@@"]), 966 genStatement = (\_ _ -> tell [" (削除) $$$ (削除ここまで)"]) }967 \end{lstlisting} (削除) (削除ここまで)968 Using \lstinline|undefined| saves (削除) needed to construct (削除ここまで)a value, \\963 genStatement = (\_ _ -> tell ["(追記) ### (追記ここまで)"]) } 964 \end{lstlisting}(追記) (追記ここまで) 965 Using \lstinline|undefined| saves (追記) constructing (追記ここまで) a value, \\ 969 966 and makes sure it's not evaluated! 970 967 \end{frame} … … 1192 1189 \item e.g. applying a pure function to the result of a monadic 1193 1190 operation \\ 1191 (追記) \lstinline|(>>*) :: m a -> (a -> b) -> m b| \\ (追記ここまで) 1194 1192 \lstinline|(>>*) op f = (liftM f) op| \\ 1195 1193 \lstinline|v <- getFoo >>* fromMaybe| … … 1262 1260 \end{frame} 1263 1261 1264 \begin{frame} (削除) (削除ここまで)1265 \frametitle{ (削除) Not as generic as we'd lik (削除ここまで)e}1262 \begin{frame}(追記) [fragile] (追記ここまで) 1263 \frametitle{(追記) \dag~Insert generic swear-word her (追記ここまで)e} 1266 1264 \begin{itemize} 1267 1265 \item Bad \lstinline|Constr| equality 1268 1266 \begin{itemize} 1269 \item \lstinline$toConstr False == toConstr Nothing$ (削除) (削除ここまで)1267 \item \lstinline$toConstr False == toConstr Nothing$(追記) \dag (追記ここまで) 1270 1268 \end{itemize} 1271 1269 \item No easy way to discover number of parameters for a \lstinline|Constr|~ 1272 1270 \begin{itemize} 1273 1271 \item Have to map ``\lstinline$const undefined$'' over the sub-terms 1274 and count the length of the returned list (削除) ! (削除ここまで)1272 and count the length of the returned list(追記) \dag (追記ここまで) 1275 1273 \end{itemize} 1276 1274 \item Can't pass a type as a parameter
Note:
See TracChangeset
for help on using the changeset viewer.