[Haskell-cafe] Syntax for modifying nested product types

MR K P SCHUPKE k.schupke at imperial.ac.uk
Fri Apr 23 12:44:34 EDT 2004

I would just do:

        f' = if cond0 then f else id
        g' = if cond1 then g else id
	foo { bar = f' (bar foo) , wib = g' (wib foo) }

	I like seeing the record updated, rather than hiding it
	in a function.


More information about the Haskell-Cafe mailing list