Last active
December 8, 2016 07:20
-
-
Save shaggyone/df89b65785d8457332998c822cfccccb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = 'a'..'z' | |
b = 1..1000 | |
x = a.lazy.map { |x| puts "x-#{x}"; b.lazy.map { |y| puts "y-#{y}"; [x, y] } }.flat_map(&:itself); | |
y = a.lazy.map { |x| puts "y-#{x}"; b.lazy.map { |y| puts "y-#{y}"; [x, y] } }.flat_map(&:itself).take(2); | |
> x.select { |xx| y.include?(xx) }.any? | |
x-a | |
y-1 | |
y-a | |
y-1 | |
=> true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment