Right. I fear there's very little one could do about that. We do haveOn Wed, 2013-09-11 at 15:56 +0200, Nicolas Trangez wrote:
> I looked into this when this thread started, but bumped into at least
> one 'issue': when defining (OTOH) something like
>
> import qualified Data.ByteString as BS
> import qualified Data.ByteString.Char8 as BS8
>
> class Foldable t where
> type Elem c :: *
> foldr :: (Elem t -> b -> b) -> b -> t -> b
>
> instance Foldable BS.ByteString where
> type Elem BS.ByteString = Word8
> foldr = BS.foldr
>
> instance Foldable BS8.ByteString where
> type Elem BS8.ByteString = Char
> foldr = BS8.foldr
>
> which fails because BS.ByteString and BS8.ByteString are the same.
one single type that is a specialised container for two types. That's
fairly unusual. I'd probably just use Word8, especially since Char stuff
is a bit iffy since it's really "Char8" not a full Char.