Remi Turk <rturk <at> science.uva.nl> writes:
...
> I just noticed that in GHC.PArr, productP is defined wrongly
> 
> productP :: (Num a) => [:a:] -> a
> productP  = foldP (*) 0
> 
> in (the likely) case that PArr is deprecated, you may want to add
> a DEPRECATED-pragma.

I have just discovered that module recently through the paper
"An Approach to Fast Arrays in Haskell" at 
http://www.cse.unsw.edu.au/~chak/papers/CK03.html

I have found a bug in enumFromToP from 
http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/libraries/
base/GHC/PArr.hs?rev=1.7

enumFromThenToP 6 5 1 ==> [:6,5,4:]
enumFromThenToP 10 8 1 ==> [:10,8,6:]

Mentioning this on the friendly #haskell channel got me this suggestion:

"TheHunter: hmm, i think enumFromThenToP = ... replicateP (((z - x) `div` delta)
+ 1) delta does the trick."

Regards,

Peter Eriksen

_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to