2008/8/7 Sukit Tretriluxana [EMAIL PROTECTED]:
How in Haskell that I can create a function that curries any other function,
which receives multiple parameters, by using a the input from a list (same
data type) or a tuple (mixed data type) such that it either returns another
closure (if not all
Sukit Tretriluxana schrieb:
Thanks Tom and Henning for your response. Let me put the question in
another way by generalizing and tweaking it a little bit.
How in Haskell that I can create a function that curries *any *other
function, which receives multiple parameters, by using a the input
Thanks so much for the response so far. To Lemming's question, this is just
a theoretical question. I try comparing what I can do in Groovy with
Haskell. So far I could come up with solutions but not this one. I'm not an
expert on this but I'm not sure if template haskell or type class would come
Dear Haskell experts,
I am currently studying Groovy language. An experiment I did with its
closure is to perform closure/function curry using an array containing the
values for the parameter binding. See the sample below.
int addThemUp(a,b,c,d,e) { a+b+c+d+e }
def arrayCurry(arr, cls) {
On Thu, 7 Aug 2008, Sukit Tretriluxana wrote:
Dear Haskell experts,
I am currently studying Groovy language. An experiment I did with its
closure is to perform closure/function curry using an array containing the
values for the parameter binding. See the sample below.
int
Maybe you want something like
curryWithList :: ([a]-b)-[a]-([a]-b)
curryWithList f lst1= \lst2 -f (lst1++lst2)
addThemUp = sum
curried = curryWithList addThemUp [1,2,3,4]
curried [5] =15
On Thu, Aug 7, 2008 at 8:35 PM, Henning Thielemann
[EMAIL PROTECTED] wrote:
On Thu, 7 Aug 2008, Sukit
Thanks Tom and Henning for your response. Let me put the question in another
way by generalizing and tweaking it a little bit.
How in Haskell that I can create a function that curries *any *other
function, which receives multiple parameters, by using a the input from a
list (same data type) or a
Hello Sukit,
Friday, August 8, 2008, 3:52:51 AM, you wrote:
it requires use of typeclasses
instance C f = C (a-f)
curry (somef::(a-f)) (someas::[a]) =
(somef (head someas)) (tail someas)
and so on. look into hslua sources, for example: