
Hello Alberto, Wednesday, July 13, 2005, 8:13:48 PM, you wrote:
If there are no efficiency concerns, I would drop element-wise operations and prefer a matrix-map and a matrix-zipWith. If these operations shall remain I would somehow point to their element-wise operation in the name.
AR> There is about 5x speed gain if we map in the C side. The "optimized" floating AR> map functions could be moved to a separate module. GHC also have a RULES pragma which can be used to automatically convert, for example, "mmap (*)" to "multipleElementWise". below is examples of using this pragma in the standard GHC modules: {-# RULES "foldr/id" foldr (:) [] = \x->x "foldr/single" forall k z x. foldr k z [x] = k x z "foldr/nil" forall k z. foldr k z [] = z #-} -- Best regards, Bulat mailto:bulatz@HotPOP.com