我有一个代码:
seq {for i in [1 .. 100000000] -> i} |> Seq.take 100000;;
Real: 00:00:00.000, CPU: 00:00:00.000, GC gen0: 0, gen1: 0, gen2: 0
val it : seq<int> =
Error: Exception of type 'System.OutOfMemoryException' was thrown.
此代码导致内存不足。为什么?以及为什么在时间计算后(操作完成后)抛出异常?AFAIK,仅根据需要计算单个序列元素?