Does F# even have lazy evaluation?
Asked
Active
Viewed 1,529 times
4
-
9It seems like [a lazy question](http://msdn.microsoft.com/library/ee353813.aspx) :P. – pad Nov 09 '12 at 15:33
1 Answers
9
F# is not lazy-by-default (a la Haskell). But explicit laziness is available. See Lazy Computations on MSDN.

Daniel
- 47,404
- 11
- 101
- 179
-
Thank you. Could you provide an example in F# of a lazy prime number sequence, and how to take `n` primes from it? – mcandre Nov 09 '12 at 15:31
-
3The `Lazy` type computes a single result. You want a sequence (`IEnumerable<'T>`). Take a look at [this question](http://stackoverflow.com/q/4629734/162396) for some examples. – Daniel Nov 09 '12 at 15:35