Binary: Put -> Builder

Ross Paterson ross at soi.city.ac.uk
Fri Jan 23 15:54:24 EST 2009


On Fri, Jan 23, 2009 at 08:03:52PM +0000, Duncan Coutts wrote:
> On Fri, 2009-01-23 at 15:34 +0100, Henning Thielemann wrote:
> > Is there a way to get the underlying Builder of a 'put' of a Binary 
> > instance?
> 
> The binary package exposes the Data.Binary.Builder module so you can use
> the Builder monoid directly. There is no need to go via the Put
> wrapper. 
> 
> There is no way to get at the 'current' state of the underlying Builder
> value. In principle, it could provide the normal writer monad access
> functions. What is the use case?

I imagine one might want to make a Builder for a composite object,
using the Binary instances of some types.  And one might want to go
the other way too, defining a Binary instance using an existing Builder.


More information about the Libraries mailing list