Re: a note on the Haskerl extension to Haskell [long]

1993-04-01 Thread Nick North


I applaud the intention of the Haskerl group to make the use of Haskell
easier and, in the same spirit, I would like to suggest some further
extensions to make "literate" programming easier.

Most Haskell users (and certainly all Haskell compiler writers) also
use LaTeX, so I suggest that literate programming should be made easier
by integrating some LaTeX features into Haskell to enable automatic
pretty-printing of programs.

My first suggestion is that lists could be delimited by the itemize
environment e.g.

\begin{itemize}
first element,
second element,
long and involved third element,
fourth element
\end{itemize}

The printed version of this list would be of the form:

[first element,
 second element,
 long and involved
   third element,
 fourth element]

so indentation would be automatically taken care of.

Arrays could be similarly defined using the enumerate environment, so:

\begin{enumerate}
first, second, third
\end{enumerate}

would print as:

array (1,3) [1 := first,
 2 := second,
 3 := third]

This requires a little intelligence to work out the upper array bound,
but that is not hard.

The possibilities for mathematical programming are endless. For example:

\sum_{i=0}^{n} x_{i}

would be the sum of the first n+1 elements of the list x, and would be
printed using the sigma notation, which is much easier to read than the
Haskell equivalent.

It goes without saying that Haskerlatex (as I have dubbed it) would
print all variable names in italic, keywords in bold and so forth to
further aid the program reader.

I could go on and on about the advantages of these extensions, but I will
stop now as I would like the Haskerl group to have time to consider them
soon, as I presume it has a strictly limited lifetime.

Nick North
National Physical Laboratory




Re: a note on the Haskerl extension to Haskell [long]

1993-04-01 Thread jhf


I know it's late in the day for most of you (or already tomorrow),
but a colleague of mine here at Los Alamos has made a suggestion
I just have to pass along:

Will Partain writes
|We might then match against a list of Foos (type "[Foo]") as follows:
|
|case expr of
|  /^{Foo1 _ {4}}({Foo2 _ _})+{Foo1 _ _}?.$/ - ...

Another thing we really ought to do to demonstrate that we've arrived
and Haskell is good for real applications is to hold an obfuscated
Haskell contest.  I volunteer to moderate.

--Joe