[Haskell-cafe] Typeclass for functions taking different kinds of strings

Johan Tibell johan.tibell at gmail.com
Wed Aug 5 08:01:50 EDT 2009

On Wed, Aug 5, 2009 at 1:24 PM, Taru Karttunen <taruti at taruti.net> wrote:

> Hello
> It seems like a very common issue to have an API like:
> foo   :: String -> Foo
> fooBS :: ByteString -> Foo
> fooLBS:: L.ByteString -> Foo
> is there currently a library that makes unifying them easy?

They cannot be completely unified. A sequence of Unicode characters (String)
is not the same kind of thing as a sequence of bytes (ByteString). Going
between the two requires an encoding. A shared abstraction would support a
subset of operations that make sense on all sequences.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090805/b84a3bce/attachment.html

More information about the Haskell-Cafe mailing list