[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Chet Murthy <chet@w...> |
| Subject: | Re: vector dot multiply |
> >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--