[Haskell-cafe] Calling function with unknown number and type arguments

Sean Leather leather at cs.uu.nl
Sun Aug 16 16:07:06 EDT 2009


On Sun, Aug 16, 2009 at 17:00, Brandon S. Allbery wrote:

> On Aug 16, 2009, at 06:45 , Maciej Piechotka wrote:
>
>> I have to write a function which calls a function with unknown (i.e.
>> given in runtime) number and type of arguments.
>>
>
> Take a look at the implementation of Text.Printf.
>

Or Text.XFormat.Show in xformat while you're at it. (Warning: blatant
self-promoting.)

  http://hackage.haskell.org/package/xformat

>From the tests in the package:

  showf (Show % Int % String) 4.05 20 " blah" == "4.0520 blah"
  showf (Wrap '(' Int ')') 24 == "(24)"

Sean
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090816/d5e62c39/attachment.html


More information about the Haskell-Cafe mailing list