<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Sean - thanks very much! That helps a lot.&nbsp;</div><div><br></div><div>haskell-libs was a misspelling of the <a href="mailto:libraries@haskell.org">libraries@haskell.org</a> list, which I've taken the liberty of cc'ing once again. It's on gmane.org too.</div><div><br></div><div>Best,</div><div>-Simon</div><br><div><div>On Aug 20, 2010, at 3:36 AM, Sean Leather wrote:</div><blockquote type="cite"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex; position: static; z-index: auto; "><div style="word-wrap: break-word;"><div>Ha! :) Yes, I was "asking for it," wasn't I? And you're absolutely right. I gave examples in the announcement email when I asked for feedback, but I didn't include any in the documentation. I will fix that.</div></div></blockquote><div> <br></div><blockquote class="gmail_quote" style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex; position: static; z-index: auto; "><div style="word-wrap: break-word;"><div></div><div>I found out more at&nbsp;<a href="http://github.com/spl/xformat/tree/master/tests/" target="_blank">http://github.com/spl/xformat/tree/master/tests/</a>&nbsp;. What I was hoping for was a way to do printf, without the variable arguments which make reuse troublesome, but still using standard printf format strings. Does this lib do that ?</div> </div></blockquote><div><br>Hmm. Let me see if I can try to answer that question.<br><br>Here's a basic example:<br><br>*Text.XFormat.Show&gt; showf ("Hello " % String % " #" % Num % "!") "World" 1<br> "Hello World #1!"<br><br>As you can see, this does not use the "standard printf format string." Instead, it uses a type-indexed function 'showf' to produce a new function 'showf ("Hello " % String % " #" % Num % "!")' that allows only certain types for arguments. To help see this, here is that type:<br> <br>*Text.XFormat.Show&gt; :t showf ("Hello " % String % " #" % Num % "!")<br>showf ("Hello " % String % " #" % Num % "!") :: (Num a) =&gt; String -&gt; a -&gt; String<br> <br>Thus, we have a type-safe printf.<br><br>One option that I have considered is writing a quasiquoter to allow you to do standard printf format strings, but I haven't found a round tuit for that, yet.<br><br>Hope this answers your question. Thanks for bringing this up. xformat needs some TLC after a long time. I just didn't know how it would be used and what direction to take it in.<br> <br>BTW, what is <a href="mailto:haskell-libs@haskell.org">haskell-libs@haskell.org</a> ? I've never seen that before.<br><br>Regards,<br>Sean<br></div></div></blockquote></div><br><div><br></div></body></html>