To use the hash, I have to convert it to a ByteString, and then I suddenly have lost all this safety. I don't really see how there is any real safety gained.
That said, just exposing a direct method of getting to that ByteString without cereal (as Thomas proposed) would be an improvement. Aristid 2012/1/8 Vincent Hanquez <[email protected]>: > On 01/08/2012 04:12 AM, Aristid Breitkreuz wrote: >> >> Why? I don't actually need the hash object for anything, usually. All >> I need is the ByteString, and then I need to learn how to use the >> cereal package to get it... > > The whole rationale i believe, is having meaningful types associated to your > values so that the type checker can do its job. i.e. you don't start mixing > a hash (in binary form) and a random piece of file. > > My only problem with the Serialize instance, is that dependencies (cereal in > this case) trickle through to the user of the API, which would be solved by > Thomas' suggestion. > > -- > Vincent _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
