polyvariadic

Polyvariadic Functions in Haskell

After reading this article on writing polyvariadic functions in Haskell, I tried to write some of my own. At first I thought I'd try to generalize it - so I could have a function that returned variadic functions by collapsing arguments as given. {-# OPTIONS -fglasgow-exts #-} module Collapse where class Collapse a r | r -> a where co...

How to create a polyvariadic haskell function?

I need a function which takes an arbitrary number of arguments (All of the same type), does something whith them and afterwards gives a result back. A list of arguments is impracticable in my specific case. As I looked through the haskell libs, there is the function printf from module Text.Printf, which uses a similar trick. Poorly I co...