我有类型的 Tuple 的 seq,(x: int, y:bool)
我想找到if为 truex
的项目y=isMin
的最小值。valList
isMin
let valList = seq{ for i =0 to 8 do yield (GetVal (i,not isMin),not isMin) }
let onlyMinType (x: int, y:bool) = if y==isMin then x
let maxVal = valList |> Seq.collect(onlyMinType) |> if isMin then Seq.min else Seq.max
maxVal
我不知道在这里做什么
Seq.collect(onlyMinType)
和功能onlyMinType