Potential Network SIG

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Sat Aug 22 18:43:20 EDT 2009


On Sat, 2009-08-22 at 21:26 +0300, taruti wrote:

> > 3) Use Bytestrings (and have corrosponding .Lazy modules) for efficiency.
> > As in network-bytestring, any new API should be performance concious
> > enough to avoid String.
> 
> Ambivalent here. Does it make more sense to have a
> send :: StringLike s => ...
> or 
> sendS :: String -> ...
> sendBS :: ByteString -> ...
> sendLBS :: L.ByteString -> ...

I've never understood why people want these type classes. Just pick the
right one. Each of those types has functions for converting to each
other. Let the caller do the conversion if any needs doing, it's just a
function call.

> Also if we have separate functions we need yet another set
> of functions when Text is ready.

Which also comes with functions for converting to ByteString or String.

Duncan



More information about the Libraries mailing list