From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.6.10/8.6.6) id NAA15877 for caml-redistribution; Fri, 9 Jun 1995 13:56:07 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.6.10/8.6.6) with ESMTP id NAA15802 for ; Fri, 9 Jun 1995 13:50:59 +0200 Received: from watson.ibm.com (watson.ibm.com [129.34.139.4]) by nez-perce.inria.fr (8.6.10/8.6.9) with SMTP id NAA29555 for ; Fri, 9 Jun 1995 13:50:46 +0200 Received: from WATSON by watson.ibm.com (IBM VM SMTP V2R3) with BSMTP id 3315; Fri, 09 Jun 95 07:50:09 EDT Received: from YKTVMV by watson.vnet.ibm.com with "VAGENT.V1.0" id 1611; Fri, 9 Jun 1995 07:50:08 EDT Received: from lusitania.watson.ibm.com by yktvmv.watson.ibm.com (IBM VM SMTP V2R3) with TCP; Fri, 09 Jun 95 07:50:08 EDT Received: from localhost by lusitania.watson.ibm.com (AIX 3.2/UCB 5.64/930311) id AA30307; Fri, 9 Jun 1995 07:50:06 -0400 Message-Id: <9506091150.AA30307@lusitania.watson.ibm.com> X-Mailer: exmh version 1.5.3 12/28/94 To: caml-list@pauillac.inria.fr Subject: Re: vector dot multiply Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Fri, 09 Jun 1995 07:50:06 -0400 From: Chet Murthy Sender: weis > >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--