[Haskell-cafe] Different ByteString types

Henk-Jan van Tuyl hjgtuyl at chello.nl
Wed Aug 18 10:00:41 EDT 2010


I hope someone can help me with the following:
I am trying to check the SHA1 hash of a file, using the package cryptohash  
[0]; the following error message is displayed when I try to compile my  

     Couldn't match expected type `B.ByteString'
            against inferred type `Data.ByteString.Internal.ByteString'
     In the second argument of `(.)', namely `hashlazy'
     In the second argument of `(.)', namely `B.unpack . hashlazy'
     In the first argument of `(<$>)', namely
         `show . B.unpack . hashlazy'

The relevant lines of code are:
> import qualified Data.ByteString.Lazy as B
> import           Data.CryptoHash.SHA1  ( hashlazy )

>     hash <- show . B.unpack . hashlazy <$> B.hGetContents h

There is only one version of the bytestring package installed.

  - Windows XP
  - bytestring-
  - cryptohash-0.5.1
  - Haskell Platform 2010.2.0.0

Henk-Jan van Tuyl

P.S. A patch is needed if you want to install cryptohash with MinGW

[0] http://hackage.haskell.org/package/cryptohash


More information about the Haskell-Cafe mailing list