Basically I want to achieve a tuple (or any datatype that fits my problem) that contains a list that can be updated. Because of immutability and such the below demonstrator code does not work of course. It is only to illustrate better what I want to achieve.
I wonder of there are any elegant ways, datatypes (IOREfs?) or modules that would do that for me or if in such a case I really would need to take apart the whole tuple, and reconstruct it with the updated elements.
By the way: intuitively I would have expected that at least as long as test is not printed the list msgs will not be evaluated.
test = ("192.168.1.1", 3455, (1234566, msgs))
msgs = ["aaa", "bbbb", "ccccc"]
main = do
--print test
let msg_tmp = "first" : msgs
let msgs = msg_tmp
print msgs
print test