Let\'s say I have the following record ADT:
data Foo = Bar { a :: Integer, b :: String, c :: String }
I want a function that takes a record
This is a good job for lenses:
data Foo = Foo { a :: Int, b :: Int , c :: String } test = Foo 1 2 "Hello"
Then:
setL c "Goodbye" test
would update field 'c' of 'test' to your string.