Re: [Haskell-cafe] Mission: To take args from an n-tuple ... generally

31 Jan
2008
31 Jan
'08
10:14 a.m.
I wondered, why not take an n-tuple of arguments s.t.
multApply' :: (a1->a2->...->an->o) -> (a1,(a2,(...(an,o)...))) -> o
I'm not sure what you're trying to do here. Why is there an o in the argument? Also, do you really mean the number of arguments expected to match the number of arguments given?
You are right. It should rather be multApply' :: (a1->a2->...->an->o) -> (a1,(a2,(...(an-1,an)...))) -> o as e.g. in: multApply' take (2,['a','b','c'])
Also you might want to check out Olegon polyvariadic functions: http://okmij.org/ftp/Haskell/vararg-fn.lhs
Thanks, I will have a look at this. Martin
6320
Age (days ago)
6320
Last active (days ago)
0 comments
1 participants
participants (1)
-
Martin Hofmann