1 {- The purpose of this is to test that record update is
2 sufficiently polymorphic. See comments with
3 tcExpr (RecordUpd) in TcExpr.lhs
8 data T a b c d = MkT1 { op1 :: a, op2 :: b }
9 | MkT2 { op1 :: a, op3 :: c }
10 | MkT3 { op4 :: a, op5 :: d }
12 update1 :: a2 -> T a b c d -> T a2 b c d2
13 update1 x t = t { op1 = x }
14 -- NB: the MkT3.op4 case doesn't constrain the result because
15 -- it doesn't have an op1 field
17 update2 :: a2 -> T a b c d -> T a2 b2 c2 d
18 update2 x t = t { op4 = x }