<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV>Hi,</DIV>
<DIV>I'm having trouble with this small exercise. </DIV>
<DIV><SPAN class="pBody postableBody"></SPAN> </DIV>
<DIV><SPAN class="pBody postableBody">A function maybeA takes a list of pairs. A pair has a variable 'a' and a value 'b'. If any first element of a pair equals to any first element of another pair, the function returns Nothing. If they aren't equal, the function returns a tuple containing the first variable, its value and the value of the second variable.</SPAN></DIV>
<DIV><SPAN class="pBody postableBody"><SPAN class="pBody postableBody">maybeA :: [(a,b)] -> Maybe (a,b,b)<BR></SPAN><BR><BR>For example: [(a1,b1),(a2,b2),(a3,b3)..<WBR>] returns Nothing if a2 = a3 and returns Just (a2,b2,b3) if a2 /= a3</SPAN></DIV>
<P><SPAN class="pBody postableBody"></SPAN> </P>
<P><SPAN class="pBody postableBody">I'm currently have :</SPAN></P><SPAN class="pBody postableBody"><SPAN lang=EN>
<P>maybeA [(a1,b1),(a2,b2)] </P>
<P> |a1 == a2 = Nothing</P>
<P> |a1 /= a2 = Just (x1,y1,y2)</P>
<P>but it only takes 2 pairs. Any helps?</P>
<P> </P>
<P>Thanks</P></SPAN>
<DIV><BR><BR><BR> </SPAN></DIV></div><br>
</body></html>