[Haskell-cafe] Polyvariadic functions operating with a monoid

2010-10-08 Thread oleg
Kevin Jardine wrote: > instead of passing around lists of values with these related types, I > created a polyvariadic function polyToString... > I finally figured out how to do this, but it was a bit harder to > figure this out than I expected, and I was wondering if it might be > possible to crea

Re: [Haskell-cafe] Polyvariadic functions operating with a monoid

2010-10-03 Thread Luke Palmer
On Sun, Oct 3, 2010 at 1:26 PM, Luke Palmer wrote: > On Sun, Oct 3, 2010 at 1:24 AM, Kevin Jardine wrote: >> I had a situation where I had some related types that all had toString >> functions. >> >> Of course in Haskell, lists all have to be composed of values of >> exactly the same type, so ins

Re: [Haskell-cafe] Polyvariadic functions operating with a monoid

2010-10-03 Thread Luke Palmer
On Sun, Oct 3, 2010 at 1:24 AM, Kevin Jardine wrote: > I had a situation where I had some related types that all had toString > functions. > > Of course in Haskell, lists all have to be composed of values of > exactly the same type, so instead of passing around lists of values > with these related

[Haskell-cafe] Polyvariadic functions operating with a monoid

2010-10-03 Thread Kevin Jardine
I had a situation where I had some related types that all had toString functions. Of course in Haskell, lists all have to be composed of values of exactly the same type, so instead of passing around lists of values with these related types, I created a polyvariadic function polyToString so that I