Skip to content

Instantly share code, notes, and snippets.

@acfoltzer
Created June 13, 2012 20:33
Show Gist options
  • Save acfoltzer/2926368 to your computer and use it in GitHub Desktop.
Save acfoltzer/2926368 to your computer and use it in GitHub Desktop.
Listings settings for Haskell
\lstnewenvironment{code}
{\lstset{}%
\csname lst@SetFirstLabel\endcsname}
{\csname lst@SaveFirstLabel\endcsname}
\lstset{
language=Haskell,
basicstyle=\small\ttfamily,
flexiblecolumns=false,
basewidth={0.5em,0.45em},
% keywordstyle=\color{blue},
% commentstyle=\color{red},
literate={+}{{$+$}}1 {/}{{$/$}}1 {*}{{$*$}}1 % {=}{{$=$}}1
{>}{{$>$}}1 {<}{{$<$}}1 {\\}{{$\lambda$}}1
{\\\\}{{\char`\\\char`\\}}1
{->}{{$\rightarrow$}}2 {>=}{{$\geq$}}2 {<-}{{$\leftarrow$}}2
{<=}{{$\leq$}}2 {=>}{{$\Rightarrow$}}2
{\ .}{{$\circ$}}2 {\ .\ }{{$\circ$}}2
{>>}{{>>}}2 {>>=}{{>>=}}2 {=<<}{{=<<}}2
{|}{{$\mid$}}1
{dotdotdot}{{$\ldots$}}3
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment