[Haskell-cafe] Please explain the Lazy type differences

Ivan Lazar Miljenovic ivan.miljenovic at gmail.com
Mon Jan 17 05:51:42 CET 2011


On 17 January 2011 14:39, Roderick Ford <developer at live.com> wrote:
> I wrote this little clip, and haven't been able to figure out why the
> L.ByteString is different type than Data.ByteString.Internal.ByteString, or
> if I am just doing everything wrong here.

Because the lazy and the strict variants might have the same name and
API, but are actually two different types.  Either use Data.ByteString
or Data.ByteString.Lazy, but don't mix them.  In the case of your code
example, it appears that Crypto.Hash.SHA1 is using strict ByteStrings.

-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
IvanMiljenovic.wordpress.com



More information about the Haskell-Cafe mailing list