[Haskell-cafe] The difficulty of designing a sequence class

Bulat Ziganshin bulat.ziganshin at gmail.com
Tue Aug 1 06:37:56 EDT 2006


Hello Brian,

Tuesday, August 1, 2006, 4:23:53 AM, you wrote:

>> That's a tough call to make. Changing the kind of Sequence to * from *
>> -> * means losing the Functor, Monad, and MonadPlus superclasses and
>> all the various maps and zips.

> But there's no option if you want to be able to support non-polymorphic
> sequences like Data.ByteString etc. I think the Functor class is just 
> fundamentally too limited - it assumes the whole world is polymorphic and it
> isn't.

it's possible, at least in principle, to make ByteString parametric
class:

data PlainSequence a = ...

type ByteString = PlainSequence Word8

and then rewrite all ByteString functions so that they will work with
elements of any type, not just Word8



-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Haskell-Cafe mailing list