[Haskell-cafe] matrix computations based on the GSL

Henning Thielemann lemming at henning-thielemann.de
Mon Jul 18 08:46:18 EDT 2005


On Mon, 18 Jul 2005, Bulat Ziganshin wrote:

> GHC also have a RULES pragma which can be used to automatically
> convert, for example, "mmap (*)" to "multipleElementWise".

Nice idea! But how can GHC decide which optimization is better?

  M.map sin . M.map cos

can be optimized to

  M.map (sin . cos)

or

  M.sin . M.cos

Which is better?



More information about the Haskell-Cafe mailing list