Re: Curry patterns

From: Bernd Brassel <bbr_at_informatik.uni-kiel.de>
Date: Wed, 15 Apr 2009 16:11:29 +0200

I cannot judge from your example but maybe you simply want the following?

parse <first pattern> = ...
parse <second pattern> = ...

Гилмуллин Рушан wrote:
> 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

_______________________________________________
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 : Fri Sep 20 2019 - 07:15:07 CEST