Trying to learn how to use Data.Binary and hit a roadblock here:
http://www.haskell.org/haskellwiki/Serialisation_and_compression_with_Data_Binary
D:\Projects\haskell\serialize\ex1.hs:114:26:
Couldn't match expected type `bytestring-0.9.1.10:Data.ByteString.Lazy.Internal.ByteString'
with actual type `L.ByteString'
Expected type: Int
-> bytestring-0.9.1.10:Data.ByteString.Lazy.Internal.ByteString
Actual type: Int -> L.ByteString
In the return type of a call of `toByteString'
In the second argument of `(.)', namely `toByteString f'
D:\Projects\haskell\serialize\ex1.hs:122:21:
Couldn't match expected type `L.ByteString'
with actual type `bytestring-0.9.1.10:Data.ByteString.Lazy.Internal.ByteString'
In the first argument of `L.length', namely `fs'
In the first argument of `(+)', namely `L.length fs'
In the first argument of `(==)', namely `L.length fs + L.length is'
[Finished]
It looks like your Cabal packages are in a mess; you have multiple versions of the
bytestringpackage installed, and they’re conflicting. The most likely scenario is that thebinarypackage depends on a different version ofbytestringto the one you get when you importData.ByteString.Lazy.The easiest thing to do is probably to start from scratch by clearing out your Cabal directories. On Windows, these directories seem to be
C:\Program Files\HaskellandC:\Documents And Settings\username\Application Data\cabal. However, I think indiscriminately clearing the former would uninstall the Haskell Platform altogether, so be careful; on the other hand, the easiest thing might be to uninstall the Haskell Platform and start again. (Additionally, you’ll probably want to copy out theconfigfile first, to avoid overwriting your Cabal configuration.)cabal-devis useful to keep problems like this isolated; it builds each program in its own sandbox, so that the effects of package problems are localised and can be cleaned up easily. I don’t know how well it works on Windows, though.