data T = MkT { x :: Int } instance HasField "x" T Int where getField _ = x instance UpdateField "x" T T Int where setField _ (MkT _) x = MkT x