Context Navigation


Changeset 27


Ignore:
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

Legend:

Unmodified
Added
Removed
  • docs/trunk/200711-tock-seminars/200711-tock-slides.tex

    r26 r27
    55%include polycode.fmt
    66
    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} (追記ここまで)
    710
    811\usepackage{pifont}
    1417{
    1518 \usetheme{Rochester}
    19(追記) \usecolortheme[named=KentBlue]{structure} (追記ここまで)
    1620 \setbeamercovered{transparent}
    1721}
    4549% I would do this, but I haven't found a non-broken version of the
    4650% 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}}
    4953
    5054%Note: return isn't a Haskell keyword, but it's used enough and important
    7882 }
    7983
    80(削除) \definecolor{ForestGreen}{cmyk}{0.91,0,0.88,0.12} (削除ここまで)
    81(削除) (削除ここまで)
    8284\def\haskellsettings{
    8385\lstset{
    8587 columns=flexible,
    8688 basicstyle=\small,
    87 keywordstyle=\color{(削除) beamer@blendedb (削除ここまで)lue}\bfseries,
    89 keywordstyle=\color{(追記) KentB (追記ここまで)lue}\bfseries,
    8890 identifierstyle=,
    89 commentstyle=\color{(削除) Fores (削除ここまで)tGreen}\itshape,
    91 commentstyle=\color{(追記) Ken (追記ここまで)tGreen}\itshape,
    9092 stringstyle=,
    9193 showstringspaces=false}
    9799 columns=fixed,
    98100 basicstyle=\small\ttfamily,
    99 keywordstyle=\color{(削除) b (削除ここまで)lue}\bfseries,
    101 keywordstyle=\color{(追記) KentB (追記ここまで)lue}\bfseries,
    100102 identifierstyle=,
    101 commentstyle=\color{(削除) Fores (削除ここまで)tGreen}\itshape,
    103 commentstyle=\color{(追記) Ken (追記ここまで)tGreen}\itshape,
    102104 stringstyle=,
    103105 showstringspaces=false}
    276278\frametitle{Scrap Your Boilerplate}
    277279\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
    279283\end{itemize}
    280284\begin{lstlisting}
    285289\end{lstlisting}
    286290\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}
    315normalTransform :: a -> a
    316monadicTransform :: Monad m => a -> m a
    317query :: 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
    324292\end{itemize}
    325293\end{frame}
    328296\frametitle{Scrapping Our Boilerplate}
    329297\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
    331300 \item We can use this to write transformation passes
    332301 \begin{itemize}
    345314\begin{frame}
    346315\frametitle{Problems with generics}
    316(追記) \framesubtitle{Digging too deep} (追記ここまで)
    347317\begin{itemize}
    348318 \item \lstinline|everywhere| really does look \emph{everywhere}
    352322 \end{itemize}
    353323 \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}
    356331\end{itemize}
    357332\end{frame}
    359334\begin{frame}
    360335\frametitle{Problems with generics}
    336(追記) \framesubtitle{Looking at things in the wrong order} (追記ここまで)
    361337\begin{itemize}
    362338 \item Sometimes \lstinline|everywhere| is not the traversal we want
    363339 \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 \\
    365342 % 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}
    370350\end{itemize}
    371351\end{frame}
    373353\begin{frame}[fragile]
    374354\frametitle{Problems with generics}
    355(追記) \framesubtitle{Well, \emph{nearly} any type\ldots} (追記ここまで)
    375356\begin{itemize}
    376357 \item \lstinline|Data.Generics| has some limitations
    380361 \end{itemize}
    381362 \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}
    383366\end{itemize}
    384367\end{frame}
Note: See TracChangeset for help on using the changeset viewer.

AltStyle によって変換されたページ (->オリジナル) /