[Haskell] Re: whereis the lazyness ?

2004-12-04 Thread Fred Nicolier
No. The array really does get created with that huge number elements. The Haskell Array type is lazy in it's *elements*, not its keys. Ok thanks, i understand (my error is that i want lazy datas everywhere !!) The Array type is just your ordinary O(1) indexable structure. If you want a data

[Haskell] whereis the lazyness ?

2004-12-03 Thread Fred Nicolier
I'am a little bit confused by the following error messages : \begin{code} import Array type SignalOf = Array Int funcSignal :: (Num a, Num b) = (Int, Int) - (a - b) - SignalOf b funcSignal b f = listArray b [f (fromIntegral k) | k - range b] instance (Num a) = Num (SignalOf a) where

Re: [Haskell] package with ghc and ghci

2004-11-20 Thread Fred Nicolier
Simon Marlow wrote: Please send the output of command (2) with -v added to the command line. Cheers, Simon I have isolated the dependancies of the packages : the work file is now : \begin{code} module Main where import Data.Array import DSP.Filter.FIR.FIR import DSP.Filter.FIR.Sharpen

[Haskell] package with ghc and ghci

2004-11-15 Thread Fred Nicolier
Hello, I have some packages for doing signal and image processing stuff. Here is a little test program : \begin{code} module Main where import Hips a = listSignal (1,10) [1..10] b = liftSignals (:+) a a c = fft b main = do putStrLn $ show a putStrLn $ show b putStrLn $

[Haskell-cafe] dimension of arrays

2004-03-29 Thread Fred Nicolier
Is there a way to get the number of dimension of an array ? i.e. something like : dims :: (Ix a) = Array a b - Int dims = ... a = listArray (1,10) [1,2..] b = listArray ((1,1),(10,10)) [1,2..] dims a -- should be equal to 1 dims b -- should be equal to 2 The key is somewhere in the Ix class but

Re: [Haskell-cafe] dimension of arrays

2004-03-29 Thread Fred Nicolier
Josef Svenningsson wrote: In a sense Haskell arrays are always one dimensional. But as you noted tuples are used to achieve higher dimensionality. As far as I know there is no way of asking for the dimension of an array. You could write your own class for that though. Here's a suggestion: