
7 Oct
2005
7 Oct
'05
10:02 p.m.
Folks, In http://www.n-heptane.com/nhlab/repos/NewBinary/NewBinary/Binary.hs there's the following bit of code. What are the I#, S# and J#? instance Binary Integer where put_ bh (S# i#) = do putByte bh 0; put_ bh (I# i#) put_ bh (J# s# a#) = do p <- putByte bh 1; put_ bh (I# s#) let sz# = sizeofByteArray# a# -- in *bytes* put_ bh (I# sz#) -- in *bytes* putByteArray bh a# sz# get bh = do b <- getByte bh case b of 0 -> do (I# i#) <- get bh return (S# i#) _ -> do (I# s#) <- get bh sz <- get bh (BA a#) <- getByteArray bh sz return (J# s# a#) Thanks, Joel -- http://wagerlabs.com/idealab