Curry patterns

From: (wrong string) Гилмуллин Рушан <rus-reg_at_yandex.ru>
Date: Wed, 15 Apr 2009 17:18:21 +0400

I have one question about Curry.

I have two patterns

parse s | s =:= <first pattern> = ...
parse s | s =:= <second pattern> = ...

I want, the second match work only if the first match failed. But in fact it don't dependence. If I do:

parse s | s =:= <first pattern> = ...
parse s | (s =:= <first pattern>) =:= failed & s =:= <second pattern> = ...

this is don't work - the second pattern don't match if s =:= <first pattern> march or no.

If I do:
parse s | (s =:= <first pattern>) == success = ...
          (s =:= <second pattern>) == success = ...
                    where ...
also bad: if first pattern fail, the second don't call.

How to me to make so that the second match worked in only case when its condition is satisfied, and the second match simultaneously fails?

Best regards,
Rushan Gilmullin
_______________________________________________
curry mailing list
curry_at_lists.RWTH-Aachen.DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/curry
Received on Thu Apr 16 2009 - 09:11:13 CEST

This archive was generated by hypermail 2.3.0 : Wed Sep 18 2019 - 07:15:07 CEST