Re: [Haskell-cafe] Mission: To take args from a list... generally

2006-10-04 Thread David House
On 04/10/06, Joel Koerwer [EMAIL PROTECTED] wrote: I'm posting my solution in hopes to learn from your comments. This solution uses fundeps, multi-parameter classes, and overlapping instances. Note that I don't actually understand these things! :) Nice work! I haven't tried it out, but you

[Haskell-cafe] Mission: To take args from a list... generally

2006-10-04 Thread tpledger
Joel Koerwer wrote: Let's say I want to evaluate a function of type (a-a-...-a-a), taking the arguments from a list. If know the function ahead of time, I can simply wrap it: foo a b c d = ... wrapFoo (a:b:c:d:_) = foo a b c d But, as an exercise, I challenged myself to write a function,

Re: [Haskell-cafe] Mission: To take args from a list... generally

2006-10-04 Thread Joel Koerwer
Thanks for the link. So many variations on a theme: n-vars to a list : Oleg's solution for polyvariadic functions list + n-adic function - value : This thread list of (n_i)-adic functions + argument - list of (n_i-1)-adic functions : The link you gave. The first two had very similar