[Haskell-cafe] zip, map and zipWith for arrays

2007-09-09 Thread Axel Gerstenberger
/libraries/base/Data-Array-IArray.html but no zip, zipWith or even zipWith3. The whole point of using (unboxed) Arrays instead of lists is memory performce and speead of random access. Any hints on how to do zipWith on arrays is highly appreciated. Best, Axel Gerstenberger Henning Thielemann schrieb

[Haskell-cafe] turning an imperative loop to Haskell

2007-09-06 Thread Axel Gerstenberger
Hi all, I am completely stuck with a problem involving a loop construct from imperative programming, that I want to translate to Haskell code. The problem goes as follows: Based on a value u_n, I can calculate a new value u_{n+1} with a function f(u). u_n was calculated from u_{n-1} and so on

Re: [Haskell-cafe] turning an imperative loop to Haskell

2007-09-06 Thread Axel Gerstenberger
there was a one-liner for my problem, but I couldn't find it for days. Axel Dougal Stanton wrote: On 06/09/07, Axel Gerstenberger [EMAIL PROTECTED] wrote: module Main where import System.IO import Text.Printf main :: IO () main = do let all_results1 = take 2 $ step [1] --print