An interesting function in this context: Seq.cache, [link:msdn.microsoft.com]

By on 3/9/2011 10:10 AM ()

Hi,

do you know the Iterators of C#? It's more or less the same thing. 'a seq is AFAIK only a short name for IEnumerable<'a>.

So yes if you first take 10 elements of your seq and than again 50 the first 10 will be computed twice.

By on 3/9/2011 3:56 AM ()

Hi,

do you know the Iterators of C#? It's more or less the same thing. 'a seq is AFAIK only a short name for IEnumerable<'a>.

So yes if you first take 10 elements of your seq and than again 50 the first 10 will be computed twice.

Yes, I knew that a seq<a'> is in fact a IEnumerable<'a>. I just wanted to understand the laziness of F# sequences. Thanks.

By on 3/9/2011 4:03 AM ()

The laziness is just the same as with IEnumerable/IEnumerator - you only call MoveNext if you need to.

By on 3/9/2011 6:03 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper