4 ms·
Of course C# (and friends) has the similar problem using LINQ -- referencing what looks like the same thing, but possibly re-creating the underlying lazy IEnume
by thelazydogsback 6y ago
Of course C# (and friends) has the similar problem using LINQ -- referencing what looks like the same thing, but possibly re-creating the underlying lazy IEnumerable each time. To fix this you typically do a .ToList() but that materializes the whole thing which you may not want.
F# has Seq.Cache so the the seq stays lazy but only remembers what has come in the "past", mimicking the Clojure behavior if you want to opt-in -- I'm not sure there's a corresponding BCL fn yet for C#.