平行理解
使用 Parallel List Comprehensions 语言扩展,
[(x,y) | x <- xs | y <- ys]
相当于
zip xs ys
例:
[(x,y) | x <- [1,2,3] | y <- [10,20]]
-- [(1,10),(2,20)]
使用 Parallel List Comprehensions 语言扩展,
[(x,y) | x <- xs | y <- ys]
相当于
zip xs ys
例:
[(x,y) | x <- [1,2,3] | y <- [10,20]]
-- [(1,10),(2,20)]