Can one tell if a F# expression is lazy or not?

Category: visual studio fsharp


Captain Kernel on Sun, 11 Oct 2015 17:08:13

Probably a dumb question - related to an earlier question of mine - but is there a way (or perhaps a function?) one can examine some F# expression and tell whether or not it's lazily evaluated? Must one rely on visual inspection and familiarity with the detailed semantics of the language/libraries?



Mr. Tines on Sun, 11 Oct 2015 18:48:12

F# is mostly eager.   In particular any time a pipeline process results in a list or an array, it is eagerly evaluated.  Seqs aren't, nor are expressions expressly marked as lazy.