"listProduct" -- is this a standard function?

K. Fritz Ruehr fruehr at willamette.edu
Fri Oct 17 00:39:14 EDT 2003

I don't know of a type-based search tool for Haskell libraries, but I
vaguely recall someone pursuing this idea using type isomorphisms to
provide more robust results. This actually came up at lunch the other
day*, where someone pointed out that you'd want to allow not only for type
isomorphisms (e.g., argument order), but also for functions which might
fit your spec. when instantiated with (say) some default argument. I don't
know if this latter idea was addressed in any of the "TI" work, eg Di
Cosmo's book (see also Rittri, Thatte, and others). Note that much of the
TI work mentions library search as a motivation--I thought that someone
might actually have implemented something for Haskell, though.

In any case, and until someone might fill in my vaque recall, my students
have found the reference tool at zvon.org quite helpful: there is a
type-based index of the standard libraries at:


(but note that the class qualifiers are missing, so that sequence looks
more general than it really is).

They also have nice indices tied to the library structure, e.g., the
Prelude index at:


  --  Fritz

* Type isomorphisms don't often come up over lunch in my regular venue,
but I am fortunate enough to be spending some sabbatical time with the
PacSoft group at the Oregon Graduate Institute (highly recommended).

PS: A quick googling suggests that perhaps I was remembering a paper by
Rittri in JFP vol. 1, #1, which I don't have handy. Does anyone know if a
practical tool was ever released?


Graham Klyne wrote:
> At 22:04 15/10/03 -0500, Matt Harden wrote:
>>On Wednesday 15 October 2003 11:07 am, Graham Klyne wrote:
>> > I've constructed a "listProduct" function that I think I've seen
>> somewhere
>> > else... is it a standard function?  If so, where is it defined?
>>Yes.  It's called "sequence".  It's defined in the prelude.
>>It works with arbitrary monads, not just lists.
> That's the one, thanks (both of you).
> I *thought* I'd seen this function before.
> I observe this seems to be a recurring problem for me... there are so many
> very generic and useful data handling functions in Haskell, it's difficult
> for a jobbing programmer (as opposed to a language expert) to be on top of
> them all.  And the very generic nature of these function means that it's
> not so easy to index them (e.g. in the way that the Java Developers
> Almanac
> series does for Java).
> Am I overlooking any important developer resources?
> #g
> ------------
> Graham Klyne
> For email:
> http://www.ninebynine.org/#Contact

More information about the Haskell-Cafe mailing list