@@ -1,11 +1,25 @@
1−%\usepackage{amstex}
1+%% ------------------------------------------- [ Functional Programming Macros ]
2−\usepackage{amssymb}
2+%% A Package to provide support for functional programming.
4+\NeedsTeXFormat{LaTeX2e}[1994/06/01]
5+\ProvidesPackage{fpmacros}[2013/12/17 fpmacros]
6+%% ------------------------------------------------------- [ Required Packages ]
7+\RequirePackage{ifthen}
8+\RequirePackage{amssymb}
3−\usepackage{latexsym}
9+\RequirePackage{latexsym}
4−\usepackage{eepic}
10+\RequirePackage{eepic}
5−
11+\RequirePackage{fancyvrb}
12+%% ----------------------------------------------------- [ Option Delcarations ]
14+\setboolean{useverb}{true}
16+\DeclareOption{noverb}{%
17+ \setboolean{useverb}{false}
7−%%%%%%%%% INFERENCE RULES
20+\ProcessOptions\relax
22+%% --------------------------------------------------------- [ Inference Rules ]
9\newlength{\rulevgap}
23\newlength{\rulevgap}
10\setlength{\rulevgap}{0.05in}
24\setlength{\rulevgap}{0.05in}
11\newlength{\ruleheight}
25\newlength{\ruleheight}
@@ -78,8 +92,7 @@
78\setlength{\unitlength}{0.0005in}
92\setlength{\unitlength}{0.0005in}
79\begin{picture}(69,180)(0,12)
93\begin{picture}(69,180)(0,12)
80\blacken\path(12,192)(12,12)(57,102)
94\blacken\path(12,192)(12,12)(57,102)
82−\path(12,192)(12,12)(57,102)
95+ (12,192)(12,192)\path(12,192)(12,12)(57,102)
83 (12,192)(12,192)
96 (12,192)(12,192)
84\end{picture}
97\end{picture}
@@ -305,18 +318,20 @@
306\newcommand{\DBOX}[2]{\fbox{\parbox{#1}{\textbf{Definition:}#2}}}
319\newcommand{\DBOX}[2]{\fbox{\parbox{#1}{\textbf{Definition:}#2}}}
321+\ifthenelse{\boolean{useverb}}{%
308−\newcommand{\useverbtb}[1]{\begin{tiny}\BUseVerbatim{#1}\end{tiny}}
322+ \newcommand{\useverbtb}[1]{\begin{tiny}\BUseVerbatim{#1}\end{tiny}}
309−\newcommand{\useverb}[1]{\BUseVerbatim{#1}}
323+ \newcommand{\useverb}[1]{\BUseVerbatim{#1}}
310−\newcommand{\useverbs}[1]{\begin{small}\BUseVerbatim{#1}\end{small}}
324+ \newcommand{\useverbs}[1]{\begin{small}\BUseVerbatim{#1}\end{small}}
311−\newcommand{\useverbb}[1]{\begin{small}\BUseVerbatim{#1}\end{small}}
325+ \newcommand{\useverbb}[1]{\begin{small}\BUseVerbatim{#1}\end{small}}
326+ \newcommand{\codefig}[2]{\begin{figure}[h]\useverb{#1}\caption{#2}\label{#1}\end{figure}}
327+ \newcommand{\codefigs}[2]{\begin{figure}[h]\useverbs{#1}\caption{#2}\label{#1}\end{figure}}
328+ \newcommand{\codefigt}[2]{\begin{figure}[t]\useverb{#1}\caption{#2}\label{#1}\end{figure}}
329+ \newcommand{\codefigb}[2]{\begin{figure}[b]\useverb{#1}\caption{#2}\label{#1}\end{figure}}
330+ \newcommand{\codefigtc}[2]{\begin{figure*}[t]\useverb{#1}\caption{#2}\label{#1}\end{figure}}
313\newcommand{\diagfig}[3]{\begin{figure}[h]\begin{center}\includegraphics[width=#1]{#2}\end{center}
333\newcommand{\diagfig}[3]{\begin{figure}[h]\begin{center}\includegraphics[width=#1]{#2}\end{center}
314\caption{#3}\label{#2}\end{figure}}
334\caption{#3}\label{#2}\end{figure}}
315−\newcommand{\codefig}[2]{\begin{figure}[h]\useverb{#1}\caption{#2}\label{#1}\end{figure}}
316−\newcommand{\codefigs}[2]{\begin{figure}[h]\useverbs{#1}\caption{#2}\label{#1}\end{figure}}
317−\newcommand{\codefigt}[2]{\begin{figure}[t]\useverb{#1}\caption{#2}\label{#1}\end{figure}}
318−\newcommand{\codefigb}[2]{\begin{figure}[b]\useverb{#1}\caption{#2}\label{#1}\end{figure}}
319−\newcommand{\codefigtc}[2]{\begin{figure*}[t]\useverb{#1}\caption{#2}\label{#1}\end{figure}}
320\newcommand{\diagfigtc}[3]{\begin{figure*}[t]\begin{center}\includegraphics[width=#1]{#2}\end{center}
335\newcommand{\diagfigtc}[3]{\begin{figure*}[t]\begin{center}\includegraphics[width=#1]{#2}\end{center}
321\caption{#3}\label{#2}\end{figure*}}
336\caption{#3}\label{#2}\end{figure*}}
@@ -324,10 +339,13 @@
324\newcommand{\FFIG}[3]{\begin{figure}\begin{center}\DM{#1}\end{center}\caption{#2}\label{#3}\end{figure}}
339\newcommand{\FFIG}[3]{\begin{figure}\begin{center}\DM{#1}\end{center}\caption{#2}\label{#3}\end{figure}}
325\newcommand{\FFIGB}[3]{\begin{figure}[b]\begin{center}\DM{#1}\end{center}\caption{#2}\label{#3}\end{figure}}
340\newcommand{\FFIGB}[3]{\begin{figure}[b]\begin{center}\DM{#1}\end{center}\caption{#2}\label{#3}\end{figure}}
326\newcommand{\FFIGTC}[3]{\begin{figure*}[t]\begin{center}\DM{#1}\end{center}\caption{#2}\label{#3}\end{figure*}}
341\newcommand{\FFIGTC}[3]{\begin{figure*}[t]\begin{center}\DM{#1}\end{center}\caption{#2}\label{#3}\end{figure*}}
327−\newcommand{\VFIG}[3]{\begin{figure}[h]\begin{boxedverbatim}#1\end{boxedverbatim}\caption{#2}\label{#3}\end{figure}}
328\newcommand{\PFIG}[3]{\begin{figure}[p]\begin{center}\fbox{\DM{#1}}\end{center}\caption{#2}\label{#3}\end{figure}}
342\newcommand{\PFIG}[3]{\begin{figure}[p]\begin{center}\fbox{\DM{#1}}\end{center}\caption{#2}\label{#3}\end{figure}}
329\newcommand{\CFIG}[3]{\begin{figure}[h]\begin{center}\DM{#1}\end{center}\caption{#2}\label{#3}\end{figure}}
343\newcommand{\CFIG}[3]{\begin{figure}[h]\begin{center}\DM{#1}\end{center}\caption{#2}\label{#3}\end{figure}}
345+\ifthenelse{\boolean{useverb}}{%
346+ \newcommand{\VFIG}[3]{\begin{figure}[h]\begin{boxedverbatim}#1\end{boxedverbatim}\caption{#2}\label{#3}\end{figure}}
331\newcommand{\TFIG}[4]{\begin{figure}[h]\begin{center}\begin{tabular}{#1}#2\end{tabular}\end{center}\caption{#3}\label{#4}\end{figure}}
349\newcommand{\TFIG}[4]{\begin{figure}[h]\begin{center}\begin{tabular}{#1}#2\end{tabular}\end{center}\caption{#3}\label{#4}\end{figure}}
332\newcommand{\TFIGTC}[4]{\begin{figure*}[t]\begin{center}\begin{tabular}{#1}#2\end{tabular}\end{center}\caption{#3}\label{#4}\end{figure*}}
350\newcommand{\TFIGTC}[4]{\begin{figure*}[t]\begin{center}\begin{tabular}{#1}#2\end{tabular}\end{center}\caption{#3}\label{#4}\end{figure*}}
@@ -676,8 +694,9 @@ Program & Version & Instructions & Thunks & Memory Accesses & Cells \\
676\newcommand{\falsecase}{\Cases{\False}}
694\newcommand{\falsecase}{\Cases{\False}}
697+\ifthenelse{\boolean{useverb}}{%
679−\newcommand{\Haskell}[1]{\begin{quotation}\begin{verbatim}#1\end{verbatim}\end{quotation}}
698+ \newcommand{\Haskell}[1]{\begin{quotation}\begin{verbatim}#1\end{verbatim}\end{quotation}}
681% Quicksort
700% Quicksort
683\newcommand{\QSView}{\TC{QuickSort}}
702\newcommand{\QSView}{\TC{QuickSort}}
@@ -1063,4 +1082,5 @@ Program & Version & Instructions & Thunks & Memory Accesses & Cells \\
1063\newcommand{\direct}[1]{\texttt{\%#1}}
1082\newcommand{\direct}[1]{\texttt{\%#1}}
1065\newcommand{\Feature}[1]{\textbf{Remark:}}
1084\newcommand{\Feature}[1]{\textbf{Remark:}}
1066−%\newcommand{\Remark}[1]{\textbf{Remark:}}
1085+