Summary

This chapter covers one of the cornerstones of the F# data processing, namely sequences. The existing F# core sequence library allows you to apply all typical patterns of functional data processing.

When you feel an urge to implement just another custom function for sequence processing, the first thing you need to do is determine which known pattern groups it would belong to and then check twice whether this function is really not implemented already or whether it can be simply composed from the remaining library functions. Recollect the Minimizing moving parts over hiding them section from Chapter 1, Begin Thinking Functionally. Core libraries are minimalistic sets of such high-quality parts, so sticking to them eventually positively influences the quality and readability of your code.

You obtained plenty of details about the inner workings of the F# sequences and should now be able to produce sequences by a variety of means by dealing, when appropriate, with conceptually clean sequences of indefinite length.

Finally, I provided some sequence performance clues and considerations accompanied by some practical optimization coding, leaving you in a good position for further mastery.

In the next chapter, I will revisit the subject of functions as you should now be ready to pick up some advanced techniques on top of the already acquired skills.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset