
On Mar 9, 2010, at 09:41 , Yitzchak Gale wrote:
Henning Thielemann wrote:
Is NumLazyByteString a newtype around Bytestring.Lazy that interprets the bit stream represented by the ByteString as integer?
Thomas DuBuisson wrote:
Not exactly. There is not newtype wrapper. NumLazyByteString is: instance Num L.ByteString where ...
Are you absolutely certain that this is the one and only canonical instance that can ever exist that makes sense? Otherwise, please use a newtype wrapper.
Or from the other direction: you're in essence declaring that *any* ByteString can be used as a Num, etc. This strikes me as inviting confusion, at the very least; I'd strongly prefer the type system to help me distinguish ByteStrings used as Nums from those used as Strings, instead of quietly doing unexpected things (or issuing odd type errors) because I accidentally passed the wrong argument. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH