ML like pattern matching

Cagdas Ozgenc co19@cornell.edu
Fri, 22 Aug 2003 15:49:15 +0300


This is a multi-part message in MIME format.

------=_NextPart_000_03B0_01C368C4.F078C070
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Greetings,

How do I emulate the "when" clause in ML for pattern matching? In other =
words when a pattern is matched (from a list of patterns of a function) =
and to enforce additional predicates I use guards, but if the guard =
condition is not satisfied I want Haskell to get back to trying the =
remaining patterns.

Thanks


------=_NextPart_000_03B0_01C368C4.F078C070
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1170" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Greetings,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>How do I emulate the "when" clause in =
ML for=20
pattern matching? In other words when a pattern is matched (from a list =
of=20
patterns of a function)&nbsp;and to enforce additional predicates I use =
guards,=20
but if the guard condition is not satisfied I want Haskell to&nbsp;get =
back=20
to&nbsp;trying the&nbsp;remaining patterns.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_03B0_01C368C4.F078C070--