Transmitting Haskell values

Joachim Durchholz joachim.durchholz at
Tue Oct 28 17:09:36 EST 2003

Hal Daume III wrote:

> I think the standard way would be to use Show and Read and then 
> send/write/rcv/read strings from the network/disk.

What sent me first into deep confusion is that I found all of
{Text,GHC}.{Read,Show} first, and the Read classes marked as 
"nonportable GHC extensions". Quite disheartening :-(
Well, then I found the Prelude definition (though it's entirely unclear 
how they relate to the Text and GHC versions).

Hmm... I can write out functions using the "Show (a -> b)" instance, but
there's no matching "Read (a -> b)".
I do understand the technical difficulties, so I'm not really 
disappointed... but I had hoped I could handle all the code upgrade 
issues from within the language.

> Or you could use the Binary class to get binary representations, but
> these (sometimes, depending on which implementation you use) have
> endianness issues if you're transmitting between different
> architectures.

I didn't find Binary in my GHC 6.0.1 distro. Is it a library that I have
to install as an add-on?

In all, I'm finding it rather difficult to find my way in the 
documentation (just as a data point for the documentation folks).
To make the critique helpful instead of just a critique, here are a few 
ideas of what might have helped me (YMMV):

1. My main problem was that I have no good idea of all the installed 
libraries and the names defined in them (remember I'm a complete newbie 
to doing anything with a concrete Haskell installation). If somebody 
tells me to look for "Show", I have to sequentially open the indexes of 
all installed packages, and since I'm a newbie, I don't even know where 
to look first.
I'd like to see a tool that gives me a unified overview of all installed 
packages. The tool should extend the "index.html" file in the 
../doc/html directory so that it includes an entry for each installed 
library (probably copied from some "manifest.ihtml" file in the package 
directories), and it should create/extend the Haddockish 
doc-index-*.html files to be synopses of the doc-index-*.html files from 
the installed packages.
If would be best if that tool were run automatically during package 
installation :-) (particularly for newbies who are fully occupied with 
learning the language and don't have much energy or time left for 
learning tools).

2. Remove the split between "type/class index" and "function/constructor 
index" in the Haddockish doc-index.html file. For newbies like me, the 
split means we have to visit two places instead of one.
An index is for giving the reader all the usages of a word regardless of 
semantics. The doc-index-*.html file can still give kind (terminology?) 
information, e.g. in an extra column that says "function", 
"constructor", "type", or "class", respectively.

3. Some links in the indexes are bold, others aren't. I have no idea 
what they are - they /might/ differentiate between kinds, but if they 
do, I have no means to test this hypothesis. No, it seems that the 
normal ones are modules and the bold ones are uses, but I'm unable to 
determine what qualifies a module for being listed in the index for a 
given keyword, the Pool data type most certainly doesn't even appear in 
the Foreign module that's in the link list for Pool...
Well, this all is getting me thoroughly confused, any clarification 
would be appreciated.

I've got no idea how practical these ideas are, so regard them at their 
actual value :-)


More information about the Glasgow-haskell-users mailing list