有三种不同尺寸的seq
a:int = {1, 2, 3, 4}
b:string= {"a","b","a","d"}
c:string= {"y","y","t","t"}
如何使用条件
从seq:a
创建新的seq
where b="a" and c="y"
答案 0 :(得分:6)
Seq.zip3 a b c
|> Seq.choose (function (n, "a", "y") -> Some n | _ -> None)
答案 1 :(得分:1)
Seq.zip a (Seq.zip b c)
|> Seq.filter (snd >> ((=) ("a", "y")))
|> Seq.map fst