
23 Sep
2003
23 Sep
'03
9:35 a.m.
Peter Simons
setFoo :: State -> [Int] -> State setFoo st x = State { foo = x , bar = bar st }
There is an easier way to do this, using the record update syntax rather than record construction syntax. e.g. setFoo st x = st { foo = x } All the unmentioned fields retain their previous values from the 'st' structure. Regards, Malcolm