On Sat, Jan 7, 2012 at 10:12 PM, Aristid Breitkreuz <[email protected]> wrote: > 2012/1/8 Vincent Hanquez <[email protected]>: >> What would you prefer ? >> >> At the moment, i'm inclined to someday move cryptohash apis to be similar to >> crypto-api. i.e. from a result type being a bytestring to an opaque type >> with serialize/show instance. >> > > 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... > > So talking purely about convenience, I would prefer hash :: HashType > -> InputData -> ByteString. That would probably not be extensible > enough, so I'm not sure how to optimally do it. >
You could use 'hash :: Hash h => Proxy h -> ByteString -> ByteString'. where 'data Proxy a = Proxy'. Defined for you in the 'tagged' package. Antoine _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
