<div class="gmail_quote">On Wed, Sep 8, 2010 at 5:21 PM, wren ng thornton <span dir="ltr"><<a href="mailto:wren@community.haskell.org">wren@community.haskell.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>Text: break :: Text -> Text -> (Text, Text)<br>
breakBy :: (Char -> Bool) -> Text -> (Text, Text)<br>
</div></blockquote>
<br>
One consistency problem I see with this is that the ByteString versions permit breaking on a disjunctive pattern (e.g., \c -> c=='a' || c=='q') whereas the Text version would require multiple passes to perform these queries, since it takes a Text instead of a (Text->Bool).<br>
</blockquote><div><br></div><div>See breakBy in the email you quoted.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Other than that, I do agree with the philosophy of the "deliberate and sensible" differences. Though, given the philosophy that these aren't Char-wise operations, why does Text.breakBy accept a (Char->Bool)? Is this just an optimization for common cases like breaking on Unicode-defined whitespace codepoints?<br>
</blockquote><div><br></div><div>I kept breakBy in there because it is actually useful. I changed its name because it's by far less common than "I want to break on a string". </div></div><br>