Context Navigation


Changeset 12


Ignore:
Timestamp:
Nov 22, 2007, 6:50:57 PM (18 years ago)
Author:
neil.c.c.brown
Message:

Improved the Haskell syntax highlighting by defining my own list of keywords; in the default Haskell style, Monad and String are keywords, which started to make the output confusing.

File:
1 edited

Legend:

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

    r11 r12
    4444% \logo{\pgfuseimage{university-logo}}
    4545
    46(追記) %Note: the shorter keyword symbols (like =) must go before any longer (追記ここまで)
    47(追記) % versions (like =>) (追記ここまで)
    48(追記) (追記ここまで)
    49(追記) %Also, "otherkeywords" seem to be highlighted even in strings. This (追記ここまで)
    50(追記) % is partly why I haven't defined _ as a keyword. (追記ここまで)
    51(追記) (追記ここまで)
    52(追記) %String highlighting is difficult, especially since foo' is an identifier (追記ここまで)
    53(追記) % in Haskell, not the start of a char literal! Therefore I suggest (追記ここまで)
    54(追記) % never applying any special formatting to strings. I've also removed (追記ここまで)
    55(追記) % the single quote as a string delimiter for this reason. (追記ここまで)
    56(追記) \lstdefinelanguage[improved]{Haskell} (追記ここまで)
    57(追記) {morekeywords={data,type,newtype,let,do,where,if,then,else}, (追記ここまで)
    58(追記) otherkeywords={::,=,==,->,=>,>>,>>=}, (追記ここまで)
    59(追記) morecomment=[l]{--}, (追記ここまで)
    60(追記) % morestring=[b]', (追記ここまで)
    61(追記) morestring=[b]", (追記ここまで)
    62(追記) } (追記ここまで)
    63(追記) %TODO The -> operator looks particularly bad (the dash is very thin). (追記ここまで)
    64(追記) % I have seen Haskell papers that use the maths -> symbol instead -- listings (追記ここまで)
    65(追記) % package does allow us to escape to maths mode, so perhaps we should try that... (追記ここまで)
    66(追記) (追記ここまで)
    4667\begin{document}
    47\lstset{language=Haskell}
    48
    68\lstset{
    69 language={[improved]Haskell},
    70 basicstyle=\small,
    71 keywordstyle=\color{blue}\bfseries,
    72 identifierstyle=,
    73 commentstyle=\color{green}\itshape,
    74 stringstyle=,
    75 showstringspaces=false}
    76
    4977\begin{frame}
    5078 \titlepage
    242270\frametitle{Scrap Your Boilerplate}
    243271\begin{itemize}
    244 \item From the (削除) (削除ここまで)|Data.Generics| module\ldots
    272 \item From the (追記) \lstinline (追記ここまで)|Data.Generics| module\ldots
    245273\end{itemize}
    246274\begin{lstlisting}
    251279\end{lstlisting}
    252280\begin{itemize}
    253 \item (削除) (削除ここまで)|foo'| can be applied to any |Typeable| type
    281 \item (追記) \lstinline (追記ここまで)|foo'| can be applied to any |Typeable| type
    254282 \item Provides introspection and dynamic typing in Haskell
    255283\end{itemize}
Note: See TracChangeset for help on using the changeset viewer.

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