[Haskell-cafe] creating graphics the functional way

Dougal Stanton ithika at gmail.com
Sun Aug 5 19:16:26 EDT 2007

On 05/08/07, Frank Buss <fb at frank-buss.de> wrote:
> Is it possible to write functions with an arbitrary number of arguments?
> Would be nice if the average function would accept any number of pixel
> values.

I think it's possible in some sense, because the Haskell
interpretation of printf() works in the normal way. But there might be
a bit of voodoo involved.

Easier is to just pass a list of arguments to calculate over. (The
following is neither correct nor fast...)

> avg xs = sum xs `div` length xs



More information about the Haskell-Cafe mailing list