一部の言語では、遅延したシーケンスを通過した後、その言語は使い尽くされます。なぜCSVプロバイダの行を2回通過できないのですか?
open FSharp.Data
[<Literal>]
let foldr = __SOURCE_DIRECTORY__ + @"\data\"
[<Literal>]
let csvPath = foldr + @"AssetInfoFS.csv"
type AssetsInfo = CsvProvider<Sample=csvPath,
HasHeaders=true,
ResolutionFolder=csvPath,
AssumeMissingValues=false,
CacheRows=false>
let assetInfo = AssetsInfo.Load(csvPath)
assetInfo.Rows |> Seq.iter (fun x -> printfn "%A" <| x) // Works fine 1st time
assetInfo.Rows |> Seq.iter (fun x -> printfn "%A" <| x) // 2nd time exception
なぜそれが起こるん:1は、CSVプロバイダの行を一度しか行くことができるようにしかし、それは見え
let mySeq = seq [1..5]
mySeq |> Seq.iter (fun x -> printfn "%A" <| x)
mySeq |> Seq.iter (fun x -> printfn "%A" <| x)
1
2
3
4
5
1
2
3
4
5
:それはF#
の場合ではありませんか?