Invoke Haskell function with heterogeneous arguments?
Posted
by thurn
on Stack Overflow
See other posts from Stack Overflow
or by thurn
Published on 2010-03-13T02:57:58Z
Indexed on
2010/03/13
3:07 UTC
Read the original article
Hit count: 318
haskell
I'm currently working on a Haskell project which automatically tests some functions based on an XML specification. The XML specification gives the arguments to each function and the expected result that the function will provide (the arguments are of many different types). I know how to extract the function arguments from the XML and parse them using the read function, but I haven't figured out how to invoke the function using the arguments I get out.
What I basically want is to read and store the arguments in a heterogeneous list (my current thinking is to use a list of type Data.Dynamic) and then invoke the function, passing this heterogeneous list as its argument list. Is this possible? Modifying the functions under test is not an option.
© Stack Overflow or respective owner