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] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH


Attachment: PGP.sig
Description: This is a digitally signed message part

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to