3 \lstdefinelanguage{Clean}{%
4 alsoletter={ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_`1234567890},
5 alsoletter={~!@\#$\%^\&*-+=?<>:|\\.},
6 morekeywords={generic,implementation,definition,dynamic,module,import,from,where,in,of,case,let,infix,infixr,infixl,class,instance,with,if,derive},
9 morecomment=[n]{/*}{*/},
14 identifierstyle=\small\ttfamily,
15 commentstyle=\itshape,
16 keywordstyle=\bfseries,
17 stringstyle=\ttfamily,
19 showstringspaces=false,
26 escapeinside={(\#}{\#)},
28 % Basic Clean constructs
30 {A.}{{$\forall\;\,$}}1
31 {E.}{{$\exists\;\,$}}1
37 {->}{{$\rightarrow$}}2
47 {+++}{{$+\!\!\!\!+\!\!\!\!+$}}2
49 {\{|*|\}}{{$\{\!|\!\!\star\!\!|\!\}$}}3
51 % Basic iTask constructs
52 {>||>}{{$\triangleright\triangleright$}}2
53 {>>=}{{\texttt{>>=}}}3
54 {>>|}{{\texttt{>>|}}}3
55 {?>>}{{\texttt{?>>}}}3
56 {!>>}{{\texttt{!>>}}}3
57 {-||-}{{\texttt{-||-}}}4
58 {.||.}{{\texttt{.||.}}}4
59 {.&&.}{{\texttt{.\&\&.}}}4
62 \newcommand{\CleanInline}[1]{\lstinline[language=Clean]¦#1¦}
63 \newcommand{\CI}[1]{\CleanInline{#1}}
65 \lstdefinestyle{numbers}{numbers=left, stepnumber=1, numberstyle=\tiny, numbersep=5pt}
67 \lstnewenvironment{CleanCode}{\lstset{language=Clean,identifierstyle=\ttfamily}}{}
68 \lstnewenvironment{CleanCodeN}{\lstset{language=Clean,style=numbers}}{}
69 \lstnewenvironment{CleanCodeB}{\lstset{language=Clean,frame=single}}{}
70 \lstnewenvironment{CleanCodeNB}{\lstset{language=Clean,style=numbers,frame=single}}{}