Fwd: [Haskell-cafe] Bytestrings and [Char]
Alberto G. Corona
agocorona at gmail.com
Tue Mar 23 16:57:33 EDT 2010
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.
>
> 2010/3/23 Johann Höchtl <johann.hoechtl at gmail.com>
>
> On 22.03.2010 14:15, Ivan Miljenovic wrote:
>>
>>> On 23 March 2010 00:10, Johan Tibell<johan.tibell at gmail.com> wrote:
>>>
>>>
>>>> A sequence of bytes is not the same thing as a sequence of Unicode
>>>> code points. If you want to replace String by something more efficient
>>>> have a look at Data.Text.
>>>>
>>>>
>>> Though Data.Text still has the disadvantage of not being as nice to
>>> deal with as String, since you can't pattern match on it, etc.
>>>
>>> Whilst it may degrade performance, treating String as a list of
>>> characters rather than an array provides you with greater flexibility
>>> of how to deal with it.
>>>
>>>
>>>
>> But doesn't this basically mean sacrifice performance / applicability for
>> algorithmic beauty? Sure, pattern match comes in handy, but in the case of
>> strings at a high price
>>
>>
>> _______________________________________________
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100323/2713c9ee/attachment.html
More information about the Haskell-Cafe
mailing list