[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlaplus] Recursive definitions of higher-order operators



Sorry, I spoke too quickly. I realize only now that F is intended to return a sequence, not an element.

Stephan


On 07 Dec 2015, at 16:42, Stephan Merz <Stepha...@xxxxxxxxx> wrote:

You can easily define that operator without recursion:

FlatMap(F(_), seq) == [i \in 1 .. Len(seq) |-> F(seq[i])]

Stephan

On Monday, December 7, 2015 at 3:24:36 PM UTC+1, Y2i wrote:
I wish FlatMap was in standard Sequences module instead of SelectSeq:


SelectSeq(seq, Test(_)) == FlatMap(LAMBDA e : IF Test(e) THEN <<e>> ELSE <<>>, seq)


I also need FlatMap to flatten a sequence of operations with some sequence fields into a single sequence of responses.


Yuri


--
You received this message because you are subscribed to the Google Groups "tlaplus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tlaplus+u...@xxxxxxxxxxxxxxxx.
To post to this group, send email to tla...@xxxxxxxxxxxxxxxx.
Visit this group at http://groups.google.com/group/tlaplus.
For more options, visit https://groups.google.com/d/optout.