[Haskell-cafe] Bytestrings and [Char]

John Lato jwlato at gmail.com
Wed Mar 24 04:39:37 EDT 2010

Hi Alberto,

To some extent this already exists, it's just that nobody uses it.  I
believe it's the approach taken by the Edison libraries.  Also the
ListLike package provides the type classes ListLike, StringLike, and a
few others.  Neither seems to have become very popular despite having
well-respected authors (Okasaki and Goerzon, respectively).

Some container functions are already provided by other classes, namely
Foldable, Traversable, and Monoid.

The first bit, creating a tree of type classes suitable for all
containers, is probably a few hours work.

An automated system to determine the best implementation is
significantly more difficult; I can't say if the scope would be
appropriate for SoC.


> From: "Alberto G. Corona " <agocorona at gmail.com>
> Just a dream:
> -separate interface and implementation for all containers, via type classes
> -develop, by genetic programming techniques + quickcheck, a system that find
> the best container implementation for a particular program.
> Is that suitable for a Google Summer of Code project?
> 2010/3/23 Alberto G. Corona <agocorona at gmail.com>
> The question can be generalized via type classes: Is there any common set of
>> primitives encapsulated into a single type class that has instances for
>> Strings (Data.List) ByteStrings, Data.Text, Lazy bytestrings, Arrays,
>> vectors and wathever container that can store an boxed, unboxed, packed
>> unpacked sequence of wathever including chars? All of them have folds,
>> heads, tails and a lot of common functions with the same name, but since
>> there is not a single type class, the library programmer can not abstract
>> his code when it is possible, so the library user can chose the particular
>> instance for his particular problem.

More information about the Haskell-Cafe mailing list