Looking for haskell.sty or the like 
Author Message
 Looking for haskell.sty or the like

Hi,

There are a number of (La)TeX typesetting/literate programming tools
listed at http://www.*-*-*.com/ #tex. The more or less
canonical one appears to be Andrew Cooke's, but the link to
www.andrewcooke.free-online.co.uk doesn't work and I couldn't find
haskell.sty on Mr Cooke's new page (www.acooke.org/andrew/), nor could
I find it on CTAN. There _is_ a possibly related haskell.sty (dated
1998) at www.cms.dmu.ac.uk/~drs/fp/, but access is forbidden.

I've looked at Manuel Chakravarty's, at lambdaTex and at lhs2tex, but
I'd prefer something that sticks closely to the Haskell specification
(\begin{code}...\end{code}, notably), that is oriented more towards
{*filter*}than plain TeX, and as simple to use as possible for people
unfamiliar with anything but conventional word processors.

Any suggestion ?

Fran?ois



Sat, 25 Dec 2004 04:56:06 GMT  
 Looking for haskell.sty or the like

Quote:

> I've looked at Manuel Chakravarty's, at lambdaTex and at lhs2tex, but
> I'd prefer something that sticks closely to the Haskell specification
> (\begin{code}...\end{code}, notably), that is oriented more towards
>{*filter*}than plain TeX, and as simple to use as possible for people
> unfamiliar with anything but conventional word processors.

> Any suggestion ?

I assume you are talking about pretty printing??

With ConTeXt ( http://www.*-*-*.com/ ) you can do things as:

\startEIFFEL
class TEST

feature

        hello is do end

end
\stopEIFFEL

etc. It also has Perl, Pascal, XML, TeX and Java typesetting, without
inserting of any code. Just include the stuff between the right
start..stop pairs.

Writing a Haskell typesetter isn't very difficult, just inherit from the
Java or Perl code and replace the keywords that should be high-lighted
and you're already a long way.

--
Regards,

Berend. (-:



Sat, 25 Dec 2004 05:41:27 GMT  
 Looking for haskell.sty or the like

Quote:


>> I've looked at Manuel Chakravarty's, at lambdaTex and at lhs2tex, but
>> I'd prefer something that sticks closely to the Haskell specification
>> (\begin{code}...\end{code}, notably), that is oriented more towards
>>{*filter*}than plain TeX, and as simple to use as possible for people
>> unfamiliar with anything but conventional word processors.

>> Any suggestion ?

> I assume you are talking about pretty printing??

Actually, I'm talking about literate programming, of which pretty
printing is more a side effect than anything. Kind of "Literate
Programming 101", with basic{*filter*}as "advanced, far out material". I
just want to give people a glimpse of the terra incognita that lies
beyond Word and the like and I'd wish for it to be as painless and
attractive as possible.

What I'm looking for is something that allows you to markup a Haskell
program in such a way that it can be submitted as is to both{*filter*}and
hugs. Ideally, it should be unobtrusive enough for one to write simply

\documentclass{article}    % basic LaTeX, nothing fancy
\usepackage{haskell}
\begin{document}
\author{My name}
\title{I wrote a program, I really did!}
\maketitle
\section{Introduction}
"Look Mom, no hands!" \emph{Boom!}
\section{A bit later, in the hospital...}
No more of that, I'll stick to coding!
\begin{code}  % That's the Haskell part, as per the Report
        hi = "Hi to you too!"  -- Hugs should only care about this
\end{code}
\end{document}

Quote:
> With ConTeXt ( http://www.*-*-*.com/ ) you can do things as:

> \startEIFFEL
> class TEST

> feature

> hello is do end

> end
> \stopEIFFEL

> [...]

ConTeXt does look very nice and I may pick it up someday, but for now I
need the more mainstream LaTeX.

I didn't know ConTeXt could do that though, and I appreciate the
insight. Thanks.

Fran?ois



Sat, 25 Dec 2004 09:05:44 GMT  
 Looking for haskell.sty or the like
Actually, typesetting Haskell is a little bit tricky if you want the
indentation to line up correctly.  For example you might want the
different parts of a case statement to all be at the same indentation,
a little bit after the end of the word 'case'.  Or a multiple line
do-expression like

    do foo <- f x
       bar <- g x

to line up as shown.  This doesn't arise so much in imperative
languages because there a fixed N-character indent is normally used.

I too was looking for some way to typeset Haskell code and found that
haskell.sty had disappeared off the web.  In the end I did it by hand,
using LaTeX's tabular environment to deal with indentation like the
above.  I found that with TeX the 'tt' font looks good for Haskell
code, with Greek letters for type variables (following Bird's book).
But it is very laborious to do this by hand.

--

Finger for PGP key



Thu, 30 Dec 2004 08:06:27 GMT  
 Looking for haskell.sty or the like

Quote:

> Actually, typesetting Haskell is a little bit tricky if you want the
> indentation to line up correctly. [...] But it is very laborious to do
> this by hand.

I've found lambdaTeX to be very good at this, provided you're willing to
tweak its template files a little to suit your own tastes. It'll line up
your code exactly as you've laid it out in the source (using the tabular
environment, I believe), while giving you all the nice symbols and
alphabets you'd expect. The template system is also pretty general --
you can have it typeset e.g. `sqrt 5' in your code if you like.

/Liyang
--

| ++++  A programming language that doesn't affect the way you  ++++++++ |
| +++++++++++++++++  think about programming is not worth knowing.  ++++ |



Thu, 30 Dec 2004 10:12:56 GMT  
 Looking for haskell.sty or the like

Quote:

> [...]
> I too was looking for some way to typeset Haskell code and found that
> haskell.sty had disappeared off the web.  In the end I did it by hand
> [...]

I posted on Haskell Caf
( http://www.*-*-*.com/
archive) and got excellent answers, some of which you can look up
there. One suggestion is to use fancyvrb :

\usepackage{fancyvrb}
\DefineVerbatimEnvironment{code}{Verbatim}{}

Mind you, these two simple lines cover everything I needed. They allow
you to place sections of code between \begin{code}...\end{code} and
have Hugs read and understand the file without any more fuss.{*filter*}
won't pretty-print the result, but treat it as a verbatim environment,
preserving columns and the like, which is good enough for me.

For something more sophisticated, I learned that haskell.sty (Andrew
Cooke's version) is still there on the Web at
http://www.*-*-*.com/
listings environment and most of the - rather simple - code is devoted
to restyling the{*filter*}parts in a way that doesn't suit me.

As it turns out, listings makes native provision for Haskell and the
documentation reveals there's even a fancyvrb interface. So I'll
actually be rolling out my own stylesheet, based on both extensions.

Fran?ois



Thu, 30 Dec 2004 14:03:24 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Looking for someone who likes to write reports

2. RFD: comp.soft-sys.app-builder.dynasty

3. COBOL Programming Sty

4. Problems using python.sty to document a module

5. CLTL.sty, defun.tex

6. Looking for 'Numerical receipts in Haskell'

7. Looking for HASKELL compiler/interpreter...

8. I am looking for haskell/glasgow binaries

9. SORRY-looking for Haskell

10. Looking for Haskell

11. Haskell, Miranda to Haskell

12. ANNOUNCE: Glasgow Haskell 2.01 release (for Haskell 1.3) [repost]

 

 
Powered by phpBB® Forum Software