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

Re: Recursive definitions of higher-order operators



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