dictionary - Why does this code crash the second time it is executed in FSI? -
i have code generates exception second time
executed in fsi. sequence following:
1) select lines above
it, run on fsi
using alt+enter
.
2) select code, run on fsi
using alt+enter
. far no errors.
3) run selected code again hitting alt+enter
. error (see below).
here lines of code generating behavior:
let assetsmap = assetinfo.rows |> seq.filter (fun (rw: assetsinfo.row) -> set.contains rw.ticker assetstickerset) |> list.ofseq |> list.map (fun rw -> rw.ticker, asset.constructor rw) // frame.readcsv called here |> map.ofseq
relevant info:
type assetsinfo = fsharp.data.csvprovider<...>
error message:
system.invalidoperationexception: tried skip input sequence has insufficient number of elements. 1 past end of seq @ microsoft.fsharp.collections.seqmodule.skip@1316.generatenext(ienumerable`1& next) @ microsoft.fsharp.core.compilerservices.generatedsequencebase`1.movenextimpl() @ microsoft.fsharp.core.compilerservices.generatedsequencebase`1.system-collections-ienumerator-movenext() @ fsharp.data.runtime.csvhelpers.parseintotypedrows@176.generatenext(ienumerable`1& next) in c:\git\fsharp.data\src\csv\csvruntime.fs:line 176 @ microsoft.fsharp.core.compilerservices.generatedsequencebase`1.movenextimpl() @ microsoft.fsharp.core.compilerservices.generatedsequencebase`1.system-collections-ienumerator-movenext() @ microsoft.fsharp.collections.internal.ienumerator.next@187[t](fsharpfunc`2 f, ienumerator`1 e, fsharpref`1 started, unit unitvar0) @ microsoft.fsharp.collections.internal.ienumerator.filter@182.system-collections-ienumerator-movenext() @ microsoft.fsharp.collections.seqmodule.tolist[t](ienumerable`1 source) @ <startupcode$fsi_0035>.$fsi_0035.main@() in h:\dropbox\bitbucket\vsprojects\fractal10\fractal10\program.fs:line 139 stopped due error
any ideas on reason odd behavior?
Comments
Post a Comment