[Haskell-cafe] Small strings

Antoine Latter aslatter at gmail.com
Mon Dec 6 07:19:56 CET 2010


On Mon, Dec 6, 2010 at 12:09 AM, Alexander Dunlap
<alexander.dunlap at gmail.com> wrote:
>
> This looks really cool! Suggestion - would it be more efficient to
> provide direct text <-> smallstring or bytestring <-> smallstring
> functions rather than forcing clients to go through String? That might
> be useful e.g. if you were parsing (bytestring/text) data and building
> a Map in the process.
>

I'll try to come up with a direct writer from text/bytestring and see
how they stack up against going via list. I expect the direct approach
to be faster if only because asking text/bytestring for their length
will be cheaper than asking a String for its length.

I'm a bit skeptical about the to/from bytestring function, though, as
I then provide a convenient way to get to String without specifying an
encoding. But I suppose folks will want it.

On Mon, Dec 6, 2010 at 12:08 AM, Michael Snoyman <michael at snoyman.com> wrote:
>
> Is there a reason that you don't include an IsString instance?
>
> Michael
>

Laziness! This one should be easy.

Antoine



More information about the Haskell-Cafe mailing list