[Haskell-cafe] Literate Haskell source files. How do I turn them into something I can read?

Kirsten Chevalier catamorphism at gmail.com
Sun Dec 31 11:56:49 EST 2006


[redirecting to the mailing list]

On 12/31/06, Michael T. Richter <ttmrichter at gmail.com> wrote:
> On Sat, 2006-30-12 at 23:48 -0800, Kirsten Chevalier wrote:
> > I'm probably not the right person to explain why David Roundy chose to
> > write his code the way he did, since I've never even met him. However,
> > since as of 12/8/2006 there were 115 contributors to darcs, perhaps
> > reading the source code isn't as difficult as you seem to think it is.
>
> What's the secret then?  pdflatex vomits.  unlit generates a few dozen
> pages of whitespace per five-line block of code.  I'm at a loss to take
> this "literate" format and turn it into something which I can read.
>

The secret lies in adjusting your perspective. The literate format is
readable by humans as is. If there are specific things about it that
you find difficult, you can post about them here with *specific*
examples you find perplexing. But one reason why you may feel like
people aren't being helpful is that your question isn't specific
enough.

> > > I fail to see how making code which can't be read makes it more...
> > > readable.
>
> > "Can't" is an awfully strong word, isn't it?
>
> Nope.  The source files as they are are gibberish.

Again, that's an awfully strong statement. Clearly, there exist any
number of people who can read them without finding them gibberish.
Perhaps it might be better to listen to what they are telling you than
to make contradictory declarations.

> There's some kind of
> markup (of a type I can't identify) mixed up with Haskell source.  Given
> that I can't identify the markup and I'm a little hazy on Haskell at
> this point (part of the point of this exercise was to learn to read
> Haskell as it's used in real projects), the net effect is executable
> line noise.  You know, like a perl program written circa 3.0.
>

Right, if you're trying to learn to read Haskell as it's used in real
projects, reading the .lhs files as they are is the way to go. Again,
if you find specific things hard to comprehend, ask here, or on the
IRC channel. A general "all Haskell looks like line noise!" complaint
is hard for us to answer.

> > I can only explain how I did it myself, which was through practice.
>
> OK.  How do you read the literate source code?  Which tools do you use
> to separate the code from the commentary?  Which tools actually work to
> turn .lhs files into something human-readable?  (pdflatex failed on the
> GHC code as well.)
>

My eyes. And brain. I'm sorry that I can't be more helpful, but that's
what most other people I've watched reading Haskell code use, too.

Cheers,
Kirsten

-- 
Kirsten Chevalier* chevalier at alum.wellesley.edu *Often in error, never in doubt
"Memo to myself: Do the dumb things I gotta do. Touch the puppet head."
-- They Might Be Giants


More information about the Haskell-Cafe mailing list