<div dir="ltr">Data.Text definitely has a Monoid instance, it's defined in Data.Text.<div><br></div><div>- Adam</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 23, 2015 at 11:13 PM, fr33domlover <span dir="ltr"><<a href="mailto:fr33domlover@riseup.net" target="_blank">fr33domlover@riseup.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I have code which uses Text.Printf.printf with String. Now I'm moving the code<br>
to use strict Text everywhere (I picked strict since all my strings are very<br>
short, mostly less than 400 chars). What should I use instead of printf now?<br>
<br>
One solution I found is the text-format package, which seems to simply split a<br>
Text on occurences of "{}" and insert values there. Are there other simple and<br>
efficient options? All I need is to append Text values and sometimes Ints too,<br>
so it's enough to have<br>
<br>
(1) efficient append and concat<br>
(2) A function that is :: Int -> Text<br>
<br>
Why is strict Text not a Monoid instance? And Builder has no `toStrictText`<br>
function? There is a function to convert Int to Builder and a Buildable<br>
instance for Int, but for a simple Int->Text it seems I'm left with an ugly<br>
`T.pack . show`.<br>
<br>
<br>
Suggestions / advice / comments on this?<br>
<br>
Thanks in advance :)<br>
<br>
fr33<br>
<br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br></div>