[Haskell-cafe] Field updates in a state monad

Lutz Donnerhacke lutz at iks-jena.de
Thu Jan 10 10:16:21 EST 2008


* Michael Roth wrote:
> Exists there a way to write this cleaner without writing countless
> "set_xyz" helper functions?

The syntactic sugar for record modifications is simply that: sugar.
You might write your own modifier functions:
  set_bla x y = x { bla = y }


More information about the Haskell-Cafe mailing list