Вопрос

dashboard.Grid
|> Seq.mapi ^-^ fun y sx -> 
    sx  |> Seq.mapi ^-^ fun x s -> 
        if not <| s.IsEmpty && s.CellState.Color = color then 
            let psteps = s.CellState.motion( dashboard, new SPosition(x,y), color )
            if psteps <> null then
                if psteps.IsEmpty then
                    Some(psteps)
                else
                    None
            else None
        else None
    |> Seq.choose id
|> Seq.collect(fun x -> x)
|> Seq.collect(fun x -> x)

So, I just thing the last part (2 strings) of this sequence is weird. Can I open sequence another way ? List.ofSeq() doesn't work here.

thank you.

Это было полезно?

Решение

I think you're looking for Seq.concat, which is the same as Seq.collect(fun x -> x) (or Seq.collect id).

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top