[Haskell-beginners] More Deserialization Woes

Yitzchak Gale gale at sefer.org
Tue Jul 6 06:58:38 EDT 2010


I wrote:
> readNames :: Int -> Get [String]
> readNames n = replicateM n $ do
>  len <- getWord32be
>  name <- getByteString len
>  return $ UTF8.toString name

Sorry, there's a type error there. You need to
convert the Word32 to an Int:

  name <- getByteString $ fromIntegral len

Regards,
Yitz


More information about the Beginners mailing list