Re: vector dot multiply

Chet Murthy (chet@watson.ibm.com)
Fri, 09 Jun 1995 07:50:06 -0400

Message-Id: <9506091150.AA30307@lusitania.watson.ibm.com>
To: caml-list@pauillac.inria.fr
Subject: Re: vector dot multiply
Date: Fri, 09 Jun 1995 07:50:06 -0400
From: Chet Murthy <chet@watson.ibm.com>

> >Also, is there a similar construct to Haskell array/list comprehensions?
>
> Bird and Wadler's book gives a simple translation scheme
> for list comprehensions to map+filter functions (pp63-64).
> This may meet your requirements.

That translation is wildly inefficient, too. There's a reason
that lazy languages, and pure languages, haven't caught on --
it's called efficiency. It's far more efficient to construct
a decent set of imperative classes (e.g. Rogue Wave Vector Classes)
than to try to import into CAML (which was, after all, designed
to (IMHO) not penalize the imperative code writer) the constructs of
intrinsically broken languages like Haskell.

>> ...
>> Also, is there a similar construct to Haskell array/list comprehensions?
>
>There is indeed one construct called streams.

Unfortunately, these streams are *not* the same as array/list comprehensions
-- they are "read-once", lazy, and impure. So they're far more suitable
for I/O, and other such things, than for implementing such comprehensions.

--chet--