Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Function call with a list of parameters
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Markus Mottl <markus@o...>
Subject: Re: [Caml-list] Function call with a list of parameters
On Tue, 11 Dec 2001, Chris Hecker wrote:
> I have a function that returns a tuple, and a function that takes
> two curried parameters.  I'd like to pass the results of the first
> to the second, without having to break up the tuple with fst and snd
> (or pattern matching).

  let uncurry f (x, y) = f x y

> let f () = (1,2)
> let g x y = x + y
> 
> g (? f ())

  uncurry g (f ())

Regards,
Markus Mottl

-- 
Markus Mottl                                             markus@oefai.at
Austrian Research Institute
for Artificial Intelligence                  http://www.oefai.at/~markus
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr