
Yeah, that's basically it. Keeping in mind that Haskell's data structures are immutable "let stang68 = stang67" allows to use symbol "stang68" as a new Car. Whether an actual copy is made does not matter: even if both "stang"s point to the same structure you're not allowed to change its values. El mié, 13-04-2011 a las 17:27 +0200, Christopher Done escribió:
On 13 April 2011 17:22, Andrew n marshall
wrote: Is there a syntax or function to copy a record, but with select fields populated with new values?
For example, extending LYAH's Car let stang67 = Car {company="Ford", model="Mustang", year=1967} let stang68 = stang67 `mutate` Car {year=1968}
let stang67 = Car {company="Ford", model="Mustang", year=1967} let stang68 = stang67 { year = 1968 } _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners