Hi Guys ,<br><br><br>I am having a problem with patter matching .  I have declared following data type<br><br>data TestData = DataConst1 Int String<br>                        | DataConst2 Int Int <br>                        | DataConst3 Sting String<br>
                        | DataConst4 String Int<br><br><br>and now i have function <b>&quot;test&quot;</b> which behaves similarly for (DataConst1 and DataConst2 ) and behaves similarly from DataConst3 and DataConst4.<br>
<br>for ex <br><br>test (DataConst1 x y) = x<br>test (DataConst2 x y )= x<br><br>test (DataConst3 x y) = y<br>test(DataConst4 x y )= y<br><br><br>no my problem here is , is there any way i can merge these 4 statements in two statements .... some way i can match DataConst1 and DataConst2 in the same line it would save me a lot of rewriting of code <br>