Changeset 27
- Timestamp:
- Nov 23, 2007, 12:09:38 PM (18 years ago)
- Author:
- ats
- Message:
-
Add Kent logo and colours, and restructure the Generics bit.
- Location:
- docs/trunk/200711-tock-seminars
- Files:
-
- 1 added
- 1 edited
- 200711-tock-slides.tex (modified) (14 diffs)
- Kent_Comp_294_RGB.png (added)
Legend:
- Unmodified
- Added
- Removed
-
docs/trunk/200711-tock-seminars/200711-tock-slides.tex
r26 r27 5 5 %include polycode.fmt 6 6 7 (追記) \definecolor{KentBlue}{rgb}{0.0,0.2196,0.5098} (追記ここまで) 8 (追記) \definecolor{KentRed}{rgb}{0.7058,0.0117,0.3607} (追記ここまで) 9 (追記) \definecolor{KentGreen}{rgb}{0.0,0.4785,0.3686} (追記ここまで) 7 10 8 11 \usepackage{pifont} … … 14 17 { 15 18 \usetheme{Rochester} 19 (追記) \usecolortheme[named=KentBlue]{structure} (追記ここまで) 16 20 \setbeamercovered{transparent} 17 21 } … … 45 49 % I would do this, but I haven't found a non-broken version of the 46 50 % logo... 47 (削除) % \pgfdeclareimage[height=0.5 (削除ここまで)cm]{university-logo}{Kent_Comp_294_RGB}48 (削除) % (削除ここまで)\logo{\pgfuseimage{university-logo}}51 (追記) \pgfdeclareimage[height=1.0 (追記ここまで)cm]{university-logo}{Kent_Comp_294_RGB} 52 (追記) (追記ここまで)\logo{\pgfuseimage{university-logo}} 49 53 50 54 %Note: return isn't a Haskell keyword, but it's used enough and important … … 78 82 } 79 83 80 (削除) \definecolor{ForestGreen}{cmyk}{0.91,0,0.88,0.12} (削除ここまで)81 (削除) (削除ここまで)82 84 \def\haskellsettings{ 83 85 \lstset{ … … 85 87 columns=flexible, 86 88 basicstyle=\small, 87 keywordstyle=\color{ (削除) beamer@blendedb (削除ここまで)lue}\bfseries,89 keywordstyle=\color{(追記) KentB (追記ここまで)lue}\bfseries, 88 90 identifierstyle=, 89 commentstyle=\color{ (削除) Fores (削除ここまで)tGreen}\itshape,91 commentstyle=\color{(追記) Ken (追記ここまで)tGreen}\itshape, 90 92 stringstyle=, 91 93 showstringspaces=false} … … 97 99 columns=fixed, 98 100 basicstyle=\small\ttfamily, 99 keywordstyle=\color{ (削除) b (削除ここまで)lue}\bfseries,101 keywordstyle=\color{(追記) KentB (追記ここまで)lue}\bfseries, 100 102 identifierstyle=, 101 commentstyle=\color{ (削除) Fores (削除ここまで)tGreen}\itshape,103 commentstyle=\color{(追記) Ken (追記ここまで)tGreen}\itshape, 102 104 stringstyle=, 103 105 showstringspaces=false} … … 276 278 \frametitle{Scrap Your Boilerplate} 277 279 \begin{itemize} 278 \item From the \lstinline|Data.Generics| module\ldots 280 \item We use the \lstinline|Data.Generics| module, which comes 281 with GHC 282 \item Provides introspection and dynamic typing in Haskell 279 283 \end{itemize} 280 284 \begin{lstlisting} … … 285 289 \end{lstlisting} 286 290 \begin{itemize} 287 \item \lstinline|foo'| can be applied to any \lstinline|Typeable| type 288 \item Provides introspection and dynamic typing in Haskell 289 \end{itemize} 290 % FIXME: Justify choice of generics library (because it works and it 291 % comes with GHC) 292 \end{frame} 293 294 \begin{frame} 295 \frametitle{Scrap More Boilerplate} 296 \begin{itemize} 297 \item This does not automatically recurse 298 \item You get \lstinline|gmapT| -- generic \lstinline|map| -- which looks at the type and 299 maps across all the type constructor arguments 300 \item Library provides various higher-level functions built on this 301 \begin{itemize} 302 \item or you can write your own if none suit what you're trying 303 to do 304 \end{itemize} 305 \end{itemize} 306 \end{frame} 307 308 \begin{frame}[fragile] 309 \frametitle{Scrap Your Boilerstate} 310 \begin{itemize} 311 \item \lstinline|Data.Generics| also provides monadic and query versions of all 312 its functions 313 \end{itemize} 314 \begin{lstlisting} 315 normalTransform :: a -> a 316 monadicTransform :: Monad m => a -> m a 317 query :: a -> b 318 \end{lstlisting} 319 \begin{itemize} 320 \item Monadic transforms are particularly handy for carrying state around 321 \begin{itemize} 322 \item e.g. lists of defined symbols 323 \end{itemize} 291 \item Now \lstinline|foo'| can be applied to any \lstinline|Typeable| type 324 292 \end{itemize} 325 293 \end{frame} … … 328 296 \frametitle{Scrapping Our Boilerplate} 329 297 \begin{itemize} 330 \item \lstinline|everywhere| applies a transformation recursively 298 \item \lstinline|everywhere| applies a generic function 299 everywhere that it can within a data structure 331 300 \item We can use this to write transformation passes 332 301 \begin{itemize} … … 345 314 \begin{frame} 346 315 \frametitle{Problems with generics} 316 (追記) \framesubtitle{Digging too deep} (追記ここまで) 347 317 \begin{itemize} 348 318 \item \lstinline|everywhere| really does look \emph{everywhere} … … 352 322 \end{itemize} 353 323 \item Very slow! 354 \item No problem -- wrote a custom traversal function that skips over 355 ``uninteresting'' types 324 \item No problem 325 \begin{itemize} 326 \item \lstinline|Data.Generics| provides lower-level 327 functions so you can build your own traversals 328 \item Wrote a custom traversal function that skips over 329 ``uninteresting'' types 330 \end{itemize} 356 331 \end{itemize} 357 332 \end{frame} … … 359 334 \begin{frame} 360 335 \frametitle{Problems with generics} 336 (追記) \framesubtitle{Looking at things in the wrong order} (追記ここまで) 361 337 \begin{itemize} 362 338 \item Sometimes \lstinline|everywhere| is not the traversal we want 363 339 \begin{itemize} 364 \item e.g. we only want the outermost part of a recursive type 340 \item e.g. we only want the outermost part of a 341 recursive type \\ 365 342 % FIXME: emph first Par 366 \item \lstinline|Par (Par a b) (Par c d)| 367 \end{itemize} 368 \item No problem -- we can write different traversal functions for 369 different passes 343 \lstinline|Par (Par a b) (Par c d)| 344 \end{itemize} 345 \item No problem 346 \begin{itemize} 347 \item We can write different traversal functions for 348 different passes 349 \end{itemize} 370 350 \end{itemize} 371 351 \end{frame} … … 373 353 \begin{frame}[fragile] 374 354 \frametitle{Problems with generics} 355 (追記) \framesubtitle{Well, \emph{nearly} any type\ldots} (追記ここまで) 375 356 \begin{itemize} 376 357 \item \lstinline|Data.Generics| has some limitations … … 380 361 \end{itemize} 381 362 \item Problem -- we haven't found a good workaround! 382 \item As a result, the AST types aren't quite as neat as they should be\ldots 363 \begin{itemize} 364 \item As a result, the AST types aren't quite as neat as they should be\ldots 365 \end{itemize} 383 366 \end{itemize} 384 367 \end{frame}
Note:
See TracChangeset
for help on using the changeset viewer.