% CUP Journal of Functional Programming document style 
% V 0.2, 23 June 1992, by Graham White.
% V 0.3, 10 October 1992, by Joey Sams.  (Minor changes to titlepage etc.)
% V 0.4, 14 October 1992, by Alison Woollatt. (Minor changes to titlepage 
%        and \tableofcontents.)
% V 0.5, 11 December 1992, by Alison Woollatt. (Correction to drop and 
%        letterspacing for pearls options; footnote switch.)
% V 0.6, 24 December 1992 Increased footnote capacity
%
% Copyright (C) 1992 Cambridge University Press
%
% based on CUP Journal MSCS document style V 0.97
%    by Sue Brooks, 17 June 1991
% for LaTeX version 2.09
% based on ARTICLE DOCUMENT STYLE 1989
%    by Leslie Lamport
%
% incorporating also parts of authordate.sty
%    by David Rhead, Cripps Computing Centre (Feb 1990).
%
\typeout{Document Style `JFP journal style'. Version 0.6, 24 December 1992}
%
%  Journals use two-sided printing.
%
\@twosidetrue
\@mparswitchtrue
\def\ds@draft{\overfullrule 5pt}
\@options

 
%  ****************************************
%  *               FONTS                  *
%  ****************************************
%
\lineskip 1pt
\normallineskip 1pt
\def\baselinestretch{1}
\def\@normalsize{\@setsize\normalsize{13pt}\xpt\@xpt
 \abovedisplayskip 6.5pt plus 1pt minus 1pt
 \belowdisplayskip \abovedisplayskip
 \abovedisplayshortskip 3pt plus 1pt
 \belowdisplayshortskip  \abovedisplayshortskip % SFB 0.96
 \let\@listi\@listI}
\def\small{\@setsize\small{11pt}\ixpt\@ixpt
 \abovedisplayskip 6pt plus 1pt minus 1pt
 \belowdisplayskip \abovedisplayskip
 \abovedisplayshortskip 3pt plus 1pt
 \belowdisplayshortskip  \abovedisplayshortskip % SFB 0.96
 \def\@listi{\leftmargin\leftmargini
  \topsep 6pt plus 1pt minus 1pt% half line space --ggw
  \parsep \z@
  \itemsep \parsep}}
\def\footnotesize{\@setsize\footnotesize{9pt}\ixpt\@ixpt%changed ggw
 \abovedisplayskip 5pt plus 1pt minus 1pt
 \belowdisplayskip \abovedisplayskip
 \abovedisplayshortskip \z@ plus 1pt
 \belowdisplayshortskip  \abovedisplayshortskip % SFB 0.96
 \def\@listi{\leftmargin\leftmargini
  \topsep 4.5pt plus 1pt minus 1pt% half line space -- ggw
  \parsep \z@
  \itemsep \parsep}}
\def\affilsize{\@setsize\affilsize{10pt}\viiipt\@viiipt}% author's affiliation
\def\scriptsize{\@setsize\scriptsize{8pt}\viipt\@viipt}
\def\tiny{\@setsize\tiny{6pt}\vpt\@vpt}
\def\authorsize{\@setsize\authorsize{13pt}\xipt\@xipt}% author's name
\def\large{\@setsize\large{14pt}\xiipt\@xiipt}
\def\Large{\@setsize\Large{18pt}\xivpt\@xivpt}
\def\LARGE{\@setsize\LARGE{21pt}\xviipt\@xviipt}
% this is what is used for the title (which ought to be 18pt. not
% 17 pt) but 18pt is not available.
% ggw
\def\huge{\@setsize\huge{25pt}\xxpt\@xxpt}
\def\Huge{\@setsize\Huge{30pt}\xxvpt\@xxvpt}
\newfont{\bfitten}{cmbxti10}%this is ten point bold italic -- we 
% will only use it for subsection headings, so we only need it at this
%size. The full size changing mechanism is not required. ggw
\normalsize



 
%  ****************************************
%  *            PAGE LAYOUT               *
%  ****************************************
%
% SIDE MARGINS:
\oddsidemargin  2pc
\evensidemargin 2pc
\marginparwidth 2.0cm
\marginparsep 10pt

% VERTICAL SPACING:
\topmargin 2.5pc
\headheight 13pt
\headsep   13pt
\topskip = 13pt
\footheight 13pt
\footskip 26pt

% DIMENSION OF TEXT:
\textheight = 45\baselineskip \advance\textheight by \topskip
\textwidth 30pc
\columnsep 10pt
\columnseprule 0pt

% FOOTNOTES:
\footnotesep 0.pt
\skip\footins 19.5pt plus 12pt minus 1pt

% FLOATS:
\floatsep 13pt plus 6.5pt minus 1pt
\textfloatsep 15pt plus 4.5pt minus 3pt
\intextsep 13pt plus 6.5pt minus 2pt
\@maxsep 15pt
\dblfloatsep 13pt plus 6.5pt minus 2pt
\dbltextfloatsep 15pt plus 4.5pt minus 3pt
\@dblmaxsep 15pt
\@fptop 0pt plus 0fil
\@fpsep 13pt plus 0fil
\@fpbot 0pt plus 3fil
\@dblfptop 0pt plus 0fil
\@dblfpsep 13pt plus 0fil
\@dblfpbot 0pt plus 3fil
\marginparpush 5pt

 
%  ****************************************
%  *           PARAGRAPHING               *
%  ****************************************
%
\parskip \z@ plus .3pt
\parindent 1em
\partopsep 0pt plus 1pt
\@lowpenalty   51
\@medpenalty  151
\@highpenalty 301
\@beginparpenalty -\@lowpenalty
\@endparpenalty -\@lowpenalty
\@itempenalty -\@lowpenalty
\clubpenalty=0
\widowpenalty=10000

 
%  ****************************************
%  *                 PARTS                *
%  ****************************************
%
\def\part{\par \addvspace{4ex}\@afterindentfalse
 \secdef\@part\@spart}
\def\@part[#1]#2{\ifnum \c@secnumdepth >\m@ne
  \refstepcounter{part}
  \addcontentsline{toc}{part}{Part \thepart: #1}
 \else \addcontentsline{toc}{part}{#1}
 \fi
 {\parindent 0pt \centering %changed ggw
  \ifnum \c@secnumdepth >\m@ne
   \large\rm PART
   \ifcase\thepart \or ONE \or TWO \or THREE \or FOUR \or FIVE
    \or SIX \or SEVEN \or EIGHT \or NINE \or TEN \else \fi
   \par \nobreak
  \fi
  \LARGE \rm #2 \markboth{}{}\par }
 \nobreak \vskip 3ex \@afterheading}
\def\@spart#1{{\parindent 0pt \centering % changed ggw
  \LARGE \rm #1\par}
 \nobreak \vskip 3ex \@afterheading}

 
%  ****************************************
%  *               SECTIONS               *
%  ****************************************
%
\def\section{\@startsection {section}{1}{\z@}
 {-19.5pt plus -6.5pt minus -3.25pt}
 {6.5pt plus 0pt minus 1pt}
 {\centering\normalsize\bf}}
\def\subsection{\@startsection{subsection}{2}{\z@}
 {-19.5pt plus -3.25pt minus -3.25pt}
 {6.5pt plus 0pt minus 1pt}
 {\setlength{\baselineskip}{13pt}\centering\bfitten}} % this one we
 %need to change the font by hand, because we do not have a bf italic
 % font in LaTeX.
\def\subsubsection{\@startsection{subsubsection}{3}{\z@}
 {-19.5pt plus -3.25pt minus -3.25pt}%make this the same as the 2 previous
 {6.5pt plus 0pt minus 1pt}% and this one -- ggw
{\centering\normalsize\it}}
\def\paragraph{\@startsection{paragraph}{4}{\z@}
 %{13pt plus 3.25pt minus 1pt} % old value -- ggw
 %{-0.5em}%  RM modified % old value -- ggw
 {-13pt plus -1.5pt minus -1.5pt}
 {-0.5em}
{\raggedright\normalsize\it}}
\def\subparagraph{\@startsection{subparagraph}{4}{\parindent}
 %{13pt plus 3.25pt minus 1pt}%old value -- ggw
 %{-0.5em}%  RM modified old value -- ggw
 {-13pt plus -3.25pt minus -3.25pt}
 {-0.5em}
{\raggedright\normalsize\rm}}
\setcounter{secnumdepth}{3}
%
\def\@sect#1#2#3#4#5#6[#7]#8{%
 \ifnum #2>\c@secnumdepth
  \def\@svsec{}%
 \else
  \refstepcounter{#1}
%  \ifnum #2>1 % SFB 0.96 - roman numerals in sub-heads % not for JFunProg
%   \edef\@svsec{{\rm \csname the#1\endcsname.\hskip 0.5em}} % SFB 0.96
%  \else
   \edef\@svsec{\csname the#1\endcsname\hskip 0.5em } % RM modified
%  \fi
 \fi
 \@tempskipa #5\relax
 \ifdim \@tempskipa>\z@
  \begingroup #6\relax
   \@hangfrom{\hskip #3\relax\@svsec}{\interlinepenalty \@M #8\par}
  \endgroup
  \csname #1mark\endcsname{#7}%
  \addcontentsline{toc}{#1}{\ifnum #2>\c@secnumdepth \else
   \protect\numberline{\csname the#1\endcsname}\fi #7}
 \else
  \def\@svsechd{#6\hskip #3\@svsec #8\csname #1mark\endcsname
    {#7}\addcontentsline{toc}{#1}{\ifnum #2>\c@secnumdepth \else
      \protect\numberline{\csname the#1\endcsname}\fi#7}}%
 \fi
 \@xsect{#5}}
\def\appendix{\par
 \setcounter{section}{0}
 \setcounter{subsection}{0}
 \def\thesection{\Alph{section}}}
 
\setcounter{secnumdepth}{3} % i.e. number parts, sections, subsections
                            % but not paragraphs or subparagraphs.

 
%  ****************************************
%  *       PARTS & SECTIONS NUMBERS       *
%  ****************************************
%
\newcounter{part}
\newcounter {section}
\newcounter {subsection}[section]
\newcounter {subsubsection}[subsection]
\newcounter {paragraph}[subsubsection]
\newcounter {subparagraph}[paragraph]
\def\thepart          {\arabic{part}}
\def\thesection       {\arabic{section}}
\def\thesubsection    {\thesection.\arabic{subsection}}
\def\thesubsubsection {\thesubsection .\arabic{subsubsection}}
\def\theparagraph     {\thesubsubsection.\arabic{paragraph}}
\def\thesubparagraph  {\theparagraph.\arabic{subparagraph}}

 
%  ****************************************
%  *               SKIPS                  *
%  ****************************************
%
\newskip\@indentskip
\newskip\smallindent
\newskip\@footindent
\newskip\@leftskip
\@indentskip=2.5em %
\smallindent=1em
\@footindent=\smallindent
\@leftskip=\z@
\def\ls{\kern.15em} % letterspacing

 
%  ****************************************
%  *                LISTS                 *
%  ****************************************
%
\leftmargini  \@indentskip
\leftmarginii  1.5em %maybe these should all be 1.5pc?
\leftmarginiii 1.5em
\leftmarginiv  1.5em
\leftmarginv   1em
\leftmarginvi  1em
\leftmargin\leftmargini
\labelsep 5pt % this should be 1 en
\labelwidth\leftmargini\advance\labelwidth-\labelsep
%
% label macros for Range-Left and Range-Right labels
\def\makeRLlabel#1{\rlap{#1}\hss}
\def\makeRRlabel#1{\hss\llap{#1}}
%
\def\@listI{\leftmargin\leftmargini
 \parsep \z@ % SFB 0.96 remove glue
 \topsep 6.5pt plus 3pt minus 3pt%half line space before and after lists-- ggw
 \itemsep \z@ plus 1pt minus 1pt
 \let\makelabel\makeRLlabel}
\let\@listi\@listI
\@listi
\def\@listii{\leftmargin\leftmarginii
 \labelwidth\leftmarginii\advance\labelwidth-\labelsep
 \topsep 3pt plus 1pt minus 1pt
 \parsep \z@
 \itemsep \parsep
 \let\makelabel\makeRLlabel}
\def\@listiii{\leftmargin\leftmarginiii
 \labelwidth\leftmarginiii\advance\labelwidth-\labelsep
 \topsep 3pt plus 1pt minus 1pt
 \parsep \z@
 \partopsep \z@
 \itemsep \topsep
 \let\makelabel\makeRLlabel}
\def\@listiv{\leftmargin\leftmarginiv
 \labelwidth\leftmarginiv\advance\labelwidth-\labelsep
 \let\makelabel\makeRLlabel}
\def\@listv{\leftmargin\leftmarginv
 \labelwidth\leftmarginv\advance\labelwidth-\labelsep
 \let\makelabel\makeRLlabel}
\def\@listvi{\leftmargin\leftmarginvi
 \labelwidth\leftmarginvi\advance\labelwidth-\labelsep
 \let\makelabel\makeRLlabel}
%
% ITEMIZE
\def\itemize{\ifnum \@itemdepth >3 \@toodeep
  \else \advance\@itemdepth \@ne
   \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
   \list{\csname\@itemitem\endcsname}%
    {\let\makelabel\makeRRlabel}%
  \fi}
\def\labelitemi{$\bullet$} % ggw 
\def\labelitemii{---} % ggw
\def\labelitemiii{--} % ggw
\def\labelitemiv{$\cdot$}
%
% ENUMERATE
%\def\enumerate{\ifnum \@enumdepth >3 \@toodeep
% \else \advance\@enumdepth \@ne
%  \edef\@enumctr{enum\romannumeral\the\@enumdepth}%
%  \list{\csname label\@enumctr\endcsname}%
%   {\usecounter{\@enumctr}\let\makelabel\makeRLlabel}%
% \fi}
% SFB 0.96 -- enumerate with optional argument to set left margin...
\def\enumerate{\ifnum \@enumdepth >3 \@toodeep \else
  \advance\@enumdepth \@ne
  \edef\@enumctr{enum\romannumeral\the\@enumdepth}%
 \fi
 \@ifnextchar [{\@enumeratetwo}{\@enumerateone}%
}
\def\@enumeratetwo[#1]{%
 \list{\csname label\@enumctr\endcsname}%
  {\settowidth\labelwidth{[#1]}
   \leftmargin\labelwidth \advance\leftmargin\labelsep
   \usecounter{\@enumctr}
   \let\makelabel\makeRRlabel}
}
\def\@enumerateone{%
 \list{\csname label\@enumctr\endcsname}%
  {\usecounter{\@enumctr}
   \let\makelabel\makeRRlabel}}
%
\def\labelenumi{\theenumi}
\def\theenumi{\arabic{enumi}.}
\def\labelenumii{(\theenumii)}
\def\theenumii{\alph{enumii}}
\def\p@enumii{\theenumi}
\def\labelenumiii{\theenumiii}
\def\theenumiii{\roman{enumiii}}
\def\p@enumiii{\theenumi(\theenumii)}
\def\labelenumiv{\theenumiv}
\def\theenumiv{\Alph{enumiv}}
\def\p@enumiv{\p@enumiii\theenumiii}
%
% DESCRIPTION
\def\descriptionlabel#1{\hspace\labelsep \bf #1}
\def\description{\list{}{\labelwidth\z@ \itemindent-\leftmargin
  \let\makelabel\descriptionlabel}}
\let\enddescription\endlist
%
 
%  ****************************************
%  *            DISPLAYED TEXT            *
%  ****************************************
%
% VERSE
\def\verse{\let\\=\@centercr
 \list{}{\itemsep\z@
  \itemindent -\@indentskip
  \listparindent \itemindent
  \rightmargin\leftmargin
  \advance\leftmargin \@indentskip}\item[]}
\let\endverse\endlist
%
% QUOTATION
\def\quotation{\list{}{\listparindent \smallindent
  \itemindent\listparindent
  \leftmargin\z@\rightmargin\leftmargin
  \parsep 0pt plus 1pt}\item[]\small}
\let\endquotation=\endlist
%
% QUOTE
\def\quote{\list{}{\leftmargin\z@\rightmargin\leftmargin\itemindent\parinden
t}\item[]\small}
\let\endquote=\endlist

 
%  ****************************************
%  *         OTHER ENVIRONMENTS           *
%  ****************************************
%
% THEOREM
\def\@begintheorem#1#2{\rm \trivlist \item[\hskip \labelsep{\it #1\ #2}]
                                     \item[]} % modified to put body of 
                                                          % theorem statement in a separate
                                                          % item, and italics for JFunProg
                                                          % ggw
% italics for JFunProg -- ggw
\def\@opargbegintheorem#1#2#3{\rm \trivlist % SFB 0.97 -- roman
  \item[\hskip \labelsep{\it #1\ #2\ (#3)}]
  \item[]} % modified to put body of theorem statement in a separate item 
           % -- ggw
 % italics for JFunProg -- ggw
\def\@endtheorem{\endtrivlist}
%
% PROOF
\newsavebox{\proofbox}% this saves time each time proof is used
\sbox{\proofbox}{\unitlength 1pt\begin{picture}(7,7)% 
  \put(0,0){\framebox(7,7){}}\end{picture}} 
\def\proof{\rm \trivlist \item[\hskip \labelsep {\it Proof\ }]
                         \item[]} % modified to put body of theorem 
                                        %statement in a separate item.
%\def\endproof{\hspace*{\fill}{\Large$\Box$}\endtrivlist}
% for box at end of text rather than end of line:
%\def\endproof{\hspace*{\fill}\proofbox\endtrivlist}
\def\endproof{\hspace*{1em}\usebox{\proofbox}\endtrivlist}
\@namedef{proof*}{\rm \trivlist
 \item[\hskip \labelsep{\hspace*{1em}\it Proof\ }]
 \item[]} %modified to put body of theorem statement in a separate item. 
          % ggw
\@namedef{endproof*}{\endtrivlist}
%
% EQUATION and EQNARRAY 
%
% \newcounter{equation}    


\def\theequation{\arabic{equation}}

% \jot = 3pt      % Extra space added between lines of an eqnarray environment

% The macro \@eqnnum defines how equation numbers are to appear in equations.
%
%\def\@eqnnum{(\theequation)} 
% 

%
% TITLEPAGE
\def\titlepage{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
  \else \newpage \fi \thispagestyle{empty}\c@page\z@}
\def\endtitlepage{\if@restonecol\twocolumn \else \newpage \fi}
\arraycolsep 5pt
\tabcolsep 3pt % this is half the space between cols. in a tabular env. ggw
\arrayrulewidth .5pt
\doublerulesep 1.5pt
\tabbingsep \labelsep
\skip\@mpfootins = \skip\footins
\fboxsep = 3pt
\fboxrule = .5pt

 
%  ****************************************
%  *         TITLE AND ABSTRACT           *
%  ****************************************
%

\def \maketitle{ \@ifnextchar [{\m@ketitleone}{\m@ketitletwo}}%
%m@ketitletwo is the normal one -- m@ketitleone is for the pearls style
% ggw

\def \m@ketitletwo{
\m@ketitleone[n]}
        

\def\m@ketitleone[#1]{
\par
 \begingroup
  \def\thefootnote{\fnsymbol{footnote}}
  \def\@makefnmark{\hbox to 0pt{${\@thefnmark}$\hss}
                    }% fnmark now on line --
                                                     % ggw
  \newpage \global\@topnum\z@
  \@maketitle {#1} \thispagestyle{titlepage} \@thanks
 \endgroup
 \setcounter{footnote}{0}
%DWH % SFB - why changed?
%\addtocounter{footnote}{+1}% SFB 0.96 removed
 \let\maketitle\relax \let\@maketitle\relax
 \gdef\@thanks{}\gdef\@author{}\gdef\@title{}\let\thanks\relax}

\def\and{\end{author@tabular}\vskip 6pt\par % SFB 0.96
 \begin{author@tabular}[t]{@{}c@{}}} % l altered to c -- ggw
 
\def \pe@rl#1{
                \if t#1 {\tpe@rl }\else
                 \if f#1 \fpe@rl 
                                         \else \vspace*{32pt}\relax  \fi\fi}
\def \tpe@rl {\vspace*{32pt}\LARGE \rm T\ls H\ls E\ls O\ls R\ls E\ls T\ls
I\ls C\ls A\ls L$\;$\ls  P\ls E\ls A\ls R\ls L\ls S\par\vspace*{6.5pt}
               \gdef \@shorttitle{Theoretical pearls}}
\def \fpe@rl {\vspace*{32pt}\LARGE \rm F\ls U\ls N\ls C\ls T\ls I\ls O\ls
N\ls A\ls L$\;$\ls  P\ls E\ls A\ls R\ls L\ls S\par\vspace*{6.5pt}
               \gdef \@shorttitle{Functional pearls}}

\def\@maketitle#1{
\newpage
 \vspace*{-15pt} % SFB 0.96
 {\centering \sloppy
   \pe@rl {#1}
  {\LARGE \it \@title \par}
  \vskip 16pt % SFB 0.96
  {\normalsize
   \begin{author@tabular}[t]{@{}c@{}}\@author % l altered to c --ggw
   \end{author@tabular}\par}
%  \vskip 13pt
%  {\small\it Received \@date} % no ``received'' on JFunProg -- ggw
  }
% \par\noindent
 \vskip 18pt} % SFB 0.96 altered ggw


% \abstractheader makes the heading for the abstract, including the 
% horizontal rule if necessary
\def \abstractheader#1{\vbox{\hrule width \hsize 
\vskip 8pt plus 3pt minus 1pt
\centerline{\normalsize\bf  #1}}}   % Done this way because 
                                        % \section* puts too much vertical 
                                                                           
    % space before Abstract.
% now we define \abstract, using the abstractheader stuff.
\def\abstract{\abstractheader {Abstract}
\list{}{\leftmargin\z@\rightmargin\z@ \listparindent 1em % SFB 0.96 altered ggw
  \parsep 0pt plus 1pt \topsep 6.5pt plus 3pt minus 1pt}
  \item[]\small}
% \endabstract redefines \abstractheader, this time without the 
% horizontal rule -- so we avoid duplication of horizontal rules.  
\def\endabstract{\endlist\vbox{\hrule width \hsize}
                 \gdef \abstractheader ##1{\vskip 2pt
                          \centerline{\normalsize\bf  ##1}}}

% the definition of capsule review is exactly the same as abstract ...

\def\capsule{\abstractheader {Capsule Review}
\list{}{\leftmargin\z@\rightmargin\z@ \listparindent 1em % SFB 0.96 altered ggw
  \parsep 0pt plus 1pt \topsep 6.5pt plus 3pt minus 1pt}
  \item[]\small}
\def\endcapsule{\endlist\vbox{\hrule width \hsize}
                 \gdef \abstractheader ##1{\vskip 2pt
                          \centerline{\normalsize\bf  ##1}}}

\def\author@tabular{\authorsize\def\@halignto{}\@authortable}
\let\endauthor@tabular=\endtabular
\def\author@tabcrone{{\ifnum0=`}\fi\@xtabularcr\affilsize\it
 \let\\=\author@tabcrtwo\ignorespaces}
\def\author@tabcrtwo{{\ifnum0=`}\fi\@xtabularcr[-3pt]\affilsize\it
 \let\\=\author@tabcrtwo\ignorespaces}
\def\@authortable{\leavevmode \hbox \bgroup $\let\@acol\@tabacol
 \let\@classz\@tabclassz \let\@classiv\@tabclassiv
 \let\\=\author@tabcrone \ignorespaces \@tabarray}

 
%  ****************************************
%  *            PAGE STYLES               *
%  ****************************************
%
\mark{{}{}}
\gdef\@author{\mbox{}} % SFB 0.96
\def\author{\@ifnextchar [{\@authortwo}{\@authorone}}
\def\@authortwo[#1]#2{\gdef\@author{#2}\gdef\@shortauthor{#1}}
\def\@authorone#1{\gdef\@author{#1}\gdef\@shortauthor{#1}}
\def\shortauthor#1{\gdef\@shortauthor{#1}}
\gdef\@shortauthor{}
\gdef\@title{\mbox{}} % SFB 0.96
\def\title{\@ifnextchar [{\@titletwo}{\@titleone}}
\def\@titletwo[#1]#2{\gdef\@title{#2}\gdef\@shorttitle{#1}}
\def\@titleone#1{\gdef\@title{#1}\gdef\@shorttitle{#1}}
\def\shorttitle#1{\gdef\@shorttitle{#1}}
\gdef\@shorttitle{}
% SFB 0.96
\def\volume#1{\gdef\@volume{#1}} \gdef\@volume{{\bf 1} (1):}
\def\pagerange#1{\gdef\@pagerange{#1}} \gdef\@pagerange{1--000}
\def\jdate#1{\gdef\@jdate{#1}}       \gdef\@jdate{January 1992}
\def\journal#1{\gdef\@journal{#1}}   \gdef\@journal{{\it J.\ Functional\
Programming\/}}
%
% \ps@empty and \ps@plain defined in LATEX.TEX
%
\def\ps@headings{\let\@mkboth\markboth
 \def\@oddhead{ \hfil\it \@shorttitle \hfil\rm \thepage}% altered ggw
 \def\@oddfoot{}
 \def\@evenhead{\rm \thepage \hfil \it \@shortauthor \hfil }% altered ggw
 \def\@evenfoot{}
 \def\sectionmark##1{\markboth{##1}{}}
 \def\subsectionmark##1{\markright{##1}}}
\def\ps@myheadings{\let\@mkboth\@gobbletwo
 \def\@oddhead{\it \rightmark \hfill \rm \thepage}
 \def\@oddfoot{}
 \def\@evenhead{\it \leftmark \hfill \rm \thepage}
 \def\@evenfoot{}
 \def\sectionmark##1{}
 \def\subsectionmark##1{}}
\def\ps@titlepage{\let\@mkboth\@gobbletwo
 \def\@oddhead{\affilsize\@journal\ \@volume\ \@pagerange,
  \@jdate\hspace{0.5em}\copyright\ 1992 Cambridge University Press
  \hfill \normalsize\thepage}
 \def\@oddfoot{}
 \def\@evenhead{\affilsize\@journal\ \@volume\ \@pagerange,
  \@jdate\hspace{0.5em}\copyright\ 1992 Cambridge University Press
  \hfill \normalsize}
 \def\@evenfoot{}
 \def\sectionmark##1{}
 \def\subsectionmark##1{}}

 
%  ****************************************
%  *         TABLE OF CONTENTS, ETC.      *
%  ****************************************
%
\def\@pnumwidth{1.55em}
\def\@tocrmarg {2.55em}
\def\@dotsep{4.5}
\setcounter{tocdepth}{2}
\def\@undottedtocline#1#2#3#4#5{\ifnum #1>\c@tocdepth
 \else
  \vskip \z@ plus .2pt
  {\hangindent #2\relax
   \rightskip \@tocrmarg \parfillskip -\rightskip
   \parindent #2\relax \@afterindenttrue
   \interlinepenalty\@M \leavevmode
   \@tempdima #3\relax #4\nobreak \hfill \nobreak
   \hbox to\@pnumwidth{\hfil\rm #5}\par}\fi} % page number added -- ggw
\def\tableofcontents{
 \section*{Contents} \@starttoc{toc}
\par\vspace{13pt}}
\def\l@part#1#2{\addpenalty{-\@highpenalty}
 \addvspace{2.25em plus 1pt}
 \begingroup
  \parindent \z@ \rightskip \@pnumwidth
  \parfillskip -\@pnumwidth
  {\normalsize\rm
   \leavevmode \hspace*{3pc}
   #1\hfil \hbox to\@pnumwidth{\hss \ }}\par
   \nobreak \global\@nobreaktrue
   \everypar{\global\@nobreakfalse\everypar{}}\endgroup}
\def\l@section#1#2{\addpenalty{\@secpenalty}
 \@tempdima 1.5em
 \begingroup
  \parindent \z@ \rightskip \@pnumwidth
  \parfillskip -\@pnumwidth \rm \leavevmode
  \advance\leftskip\@tempdima \hskip -\leftskip
  {\bf #1}\nobreak\hfil \nobreak\hbox to\@pnumwidth{\hss #2}\par %page number
                                      % added -- ggw
 \endgroup}
\def\l@subsection{\@undottedtocline{2}{1.5em}{2.3em}}
\def\l@subsubsection{\@undottedtocline{3}{3.8em}{3.2em}}
\def\l@paragraph{\@undottedtocline{4}{7.0em}{4.1em}}
\def\l@subparagraph{\@undottedtocline{5}{10em}{5em}}
\def\listoffigures{\@restonecolfalse
 \if@twocolumn\@restonecoltrue\onecolumn\fi
\section*{List of Figures}% altered -- ggw
 \@starttoc{lof} \if@restonecol\twocolumn\fi}
\def\l@figure{\@undottedtocline{1}{1.5em}{2.3em}}
\def\listoftables{\@restonecolfalse
 \if@twocolumn\@restonecoltrue\onecolumn\fi
\section*{List of Tables}% altered -- ggw 
\@starttoc{lot} \if@restonecol\twocolumn\fi}
\let\l@table\l@figure

%  ****************************************
%  *              THE INDEX               *
%  ****************************************
%
% Index not used in JFP.
%\newif\if@restonecol
%\def\theindex{\section*{Index} % changed to U&LC -- ggw
% \addcontentsline{toc}{section}{Index}
% \footnotesize \parindent\z@ \parskip\z@ plus .1pt\relax
% \let\item\@idxitem}
%\def\@idxitem{\par\hangindent 1em}
%\def\subitem {\par\hangindent 1em \hspace*{1em}}
%\def\subsubitem{\par\hangindent 1em\hspace*{1em}}
%\def\endtheindex{\if@restonecol\onecolumn\else\clearpage\fi}
%\def\indexspace{\par\vskip\baselineskip \relax}

 
%  ****************************************
%  *             FOOTNOTES                * 
%  ****************************************
%
 \def\footnoterule{\kern-3\p@
 \hrule width .4\columnwidth height \z@ \kern 3\p@}
\long\def\@makefntext#1{\@setpar{\@@par\@tempdima \hsize
 \advance\@tempdima-\@footindent
 \parshape \@ne \@footindent \@tempdima}\par
 \noindent \hbox to \z@{\hss${\@thefnmark}$\ }#1}

\input{diff}

