+
+tripleConstr = mkConstr 1 "(,,)" Infix
+tripleDataType = mkDataType [tripleConstr]
+
+instance (Data a, Data b, Data c) => Data (a,b,c) where
+ gfoldl f z (a,b,c) = z (,,) `f` a `f` b `f` c
+ toConstr _ = tripleConstr
+ fromConstr c = case conIndex c of
+ 1 -> (undefined,undefined,undefined)
+ dataTypeOf _ = tripleDataType
+
+quadrupleConstr = mkConstr 1 "(,,,)" Infix
+quadrupleDataType = mkDataType [quadrupleConstr]
+
+instance (Data a, Data b, Data c, Data d) => Data (a,b,c,d) where
+ gfoldl f z (a,b,c,d) = z (,,,) `f` a `f` b `f` c `f` d
+ toConstr _ = quadrupleConstr
+ fromConstr c = case conIndex c of
+ 1 -> (undefined,undefined,undefined,undefined)
+ dataTypeOf _ = quadrupleDataType