Converting things to and from binary

Hal Daume III hdaume@ISI.EDU
Wed, 21 May 2003 08:48:00 -0700 (PDT)


> > Do you have an application where being in the IO monad to do this stuff
> > isn't possible, or is inconvenient?
> No.  But it is inelegant, since IO is the *only* way the bit consumer has
> of preserving state.  So if for example the target is a list of arrays and
> bytes, it would be necessary to hold the list inside an IORef or something
> similar.

You lost me here :).  I can easily agree with "it is inelegant", but I
think that as soon as you start talking about binary representations of
data types, you have to give up some elegance.

I don't understand your example of the bit consumer and IORefs
though...could you explain it a bit more (no pun)?