
21 May
2013
21 May
'13
4:35 p.m.
Hi All, I have a lot of ugly code like this: data Thing = Thing Int Int Int Int Int rewriteFourth :: Int -> Thing -> Thing rewriteFourth x (Thing a b c _ e) = Thing a b c x e Is there a better way? It was thinking about state monads that reminded me of this junk that I'd already written a while ago. Maybe it can be done by applying five StateT transformers, but I'm not entirely sure how to write that, or if there's a simpler fix. TIA, Adrian.