[prev in list] [next in list] [prev in thread] [next in thread] 

List:       haskell-cafe
Subject:    Re: [Haskell-cafe] field record update syntax
From:       John Meacham <john () repetae ! net>
Date:       2005-01-28 11:30:19
Message-ID: 20050128113019.GD17929 () momenergy ! repetae ! net
[Download RAW message or body]

On Thu, Jan 27, 2005 at 12:59:50PM -0500, S. Alexander Jacobson wrote:
> I have a lot of code of the form
> 
>   foo {bar = fn $ bar foo}
> 
> Is there a more concise syntax?  I am thinking 
> the record equivalent of C's foo+=5...
> 

you can use DrIFT to automatically create
bar_u to update a field and
bar_s to set a field.

They also behave nicer than the built in syntax as they pass through
constructors without the given field rather than return bottom.
        John

-- 
John Meacham - ⑆repetae.net⑆john⑈ 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic