[Haskell-cafe] Design suggestion for Data.Binary.Defer

David Roundy daveroundy at gmail.com
Mon Jun 16 19:12:52 EDT 2008

On Mon, Jun 16, 2008 at 9:43 AM, Neil Mitchell <ndmitchell at gmail.com> wrote:
> == The Question ==
> Is there a simple way of tagging fields in a constructor as deferred,
> just once for reading and writing, and ideally outside the instance
> definition and not requiring additional code to unwrap? I can't think
> of any, but there may be something I have missed.

Is there any reason not to just write all lazy fields of variable size
in a deferred manner? That would seem like the best option to me, but
maybe that's just because I don't see any downside besides the
requirement that one use some space to write the size.  But that seems
like it would almost always be a trivial issue, as any small data
element will have a fixed size (so that the deferred/non-deferred
distinction doesn't exist).


More information about the Haskell-Cafe mailing list