How do I have multiple generators for list comprehensions in F#?

For x in 1;2;3 do for y in 'a';'b' do yield x,y.

Just another fun way 1;2;3 |> List. Map ( fun X -> 'a';'b' |> List. Map (fun A -> X,A) ).

3 Or rather 1;2;3 |> List. Collect ( fun X -> 'a';'b' |> List. Map (fun A -> X,A) ) – Ed'ka Mar 17 at 8:12 @Ed'ka yes, it's must be better.

– nCdy Mar 17 at 8:18.

1 Not quite - this pairs up elements in corresponding positions (and therefore requires lists of the same length); the question is looking for the Cartesian product of the two lists. – kvb Mar 17 at 3:37 @kvb - Thanks for pointing out. I need to be more careful about comprehending question next time.

– nyinyithann Mar 17 at 4:47.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions