[Haskell-cafe] Re: The container problem

Achim Schneider barsoap at web.de
Fri Sep 26 15:01:35 EDT 2008


Andrew Coppin <andrewcoppin at btinternet.com> wrote:

> [...]
I completely agree that Hashtable should instance Map and alike.

>   Data.List.map :: (a -> b) -> [a] -> [b]
> 
> Other containers only support *one* type of data:
> 
>   Data.ByteString.Char8.map :: (Char -> Char) -> ByteString ->
> ByteString
> 
> The type has a different kind, and the function parameter's type is
> more constrained. Yet still this poses no problem.
> 
> However... now try writing a class that both of these functions could
> be methods of. Good luck with that, by the way...
> 
Well the type _could_ be
map :: (a -> b) -> ByteString a -> ByteString b
and have a hell a lot of plumbing that utterly destroys ByteString's
optimisation.

But then you'll be happy to know that there's already Data.Stream.List,
with more coming at the same speed as we can order pizza for dons.

http://hackage.haskell.org/trac/ghc/ticket/915


-- 
(c) this sig last receiving data processing entity. Inspect headers
for copyright history. All rights reserved. Copying, hiring, renting,
performance and/or broadcasting of this signature prohibited.



More information about the Haskell-Cafe mailing list