Define a function
cacheObserver : seq<'a> -> seq<'a>
that will cache the values of a sequence and print “Cached”
to standard output every time the value requested from the sequence is actually cached.
Define a function
cacheObserver : seq<'a> -> seq<'a>
that will cache the values of a sequence and print “Cached”
to standard output every time the value requested from the sequence is actually cached.
What have you tried so far?
Hint: There is build-in Seq.cache function. You can take a look how it is implemented.