l = [i | i <- 1..4] assert l == [1, 2, 3, 4] lc = [i * 2 | i <- 1..4] assert lc == [2, 4, 6, 8] lc2 = [i + 1 | i <- 1..5 | i <= 3] assert lc2 == [2, 3, 4] lc3 = [i <- 1..10 | i <= 5] assert lc3 == [1, 2, 3, 4, 5] lc4 = [i * 5 | i <- 1..15 | i <= 5] assert lc4 == [5, 10, 15, 20, 25] s = {i | i <- [1, 2, 1, 2]} assert s == {1, 2} sc = {i * 2 | i <- 1..4} assert sc == {2, 4, 6, 8} sc2 = {i + 1 | i <- 1..5 | i <= 3} assert sc2 == {2, 3, 4} sc3 = {i <- 1..10 | i <= 5} assert sc3 == {1, 2, 3, 4, 5} sc4 = {i % 5 | i <- 1..100 | i % 5 != 0} assert sc4 == {1, 2, 3, 4}