With the RecordWildCard extension you should be able to write
newFoo Old.Foo{..} = New.Foo { .., z=1 }
On Tue, Jul 28, 2009 at 3:47 PM, Henry Laxennadine.and.he...@pobox.com wrote:
Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk writes:
and perhaps use emacs to
query-replace all the
On Tue, Jul 28, 2009 at 7:47 AM, Henry Laxen nadine.and.he...@pobox.comwrote:
Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk writes:
and perhaps use emacs to
query-replace all the Foo1's back to Foo's
At least this bit can be avoided easily enough, by using
module qualification
the part I would really like to avoid is writing the
New.Foo { a=a, b=b, ... z=1 } part, where the field
names are many, long, and varied.
OK, here is another hack-ish trick, since I notice your data is stored
on disk as text, using show. I assume you are using something like
Read to
Hello,
you may also find the package pretty-show
(http://hackage.haskell.org/package/pretty-show) useful. It contains
code to convert automatically derived instances of Show into an
explicit data structure, which you can then manipulate (e.g., by
adding the extra field), and then render back to