def test_list_map_polymorphic_2(c, xs, ys): def square(x): return x * x def double(x): return x + x if c: f = square else: f = double return list_map(f, xs), list_map(f, ys)
def test_list_map0(): def f(): return 1234 return list_map(f)
def test_list_map2(xs, ys): def mulm(x, y): return x * -y return list_map(mulm, xs, ys)
def test_list_map(xs, ys): def square(x): return x * x return list_map(square, xs), list_map(square, ys)
def test_list_map_polymorphic(xs, ys): def square(x): return x * x return list_map(square, xs), list_map(square, ys)
def f3(xs): def f(pt): return pt.x + pt.y return list_map(f, xs)