How to modify just one field of a record without rewriting it completely? [duplicate]
问题 This question already has answers here : Shorthand way for assigning a single field in a record, while copying the rest of the fields? (3 answers) Is there a Haskell idiom for updating a nested data structure? (3 answers) Closed 8 months ago . It's the second time I'm tackling this problem... And for the second time this is while working with the State monad, apparently a state likes to consist of many fields, not just one I have a tuple: type CurrentState = (Int, Int, String, [Int],