ByteString, foldr and lazyness

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Fri Nov 28 09:14:46 EST 2008


On Thu, 2008-11-27 at 15:08 +0100, Mathieu Boespflug wrote:
> Hi all,
> 
> Here's a ghci session, using bytestring-0.9.1.4 and ghc-6.10:
> 
> Prelude> :m Data.ByteString.Lazy.Char8
> Prelude Data.ByteString.Lazy.Char8> :m -Prelude
> Data.ByteString.Lazy.Char8> foldr (:) [] (concat (Prelude.repeat "a"))

This does not typecheck.

Prelude.repeat "a" :: [String]
concat :: [ByteString] -> ByteString

hence concat (Prelude.repeat "a") is not well typed.


Duncan



More information about the Libraries mailing list