ML like pattern matching

Jonas Ritter ritter@animorph.de
Fri, 22 Aug 2003 15:24:22 +0200


Hi

Cagdas Ozgenc wrote:
> 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

Maybe you hav to reorganize the list of patterns or you use
"otherwise" as the last case of your guard conditions to call the 
function with a more general parameters which matches an other pattern.
A litle example would be helpfull.

Jonas