F# 4.0 Design Patterns by Gene Belitski

F# 4.0 Design Patterns by Gene Belitski

Author:Gene Belitski [Belitski, Gene]
Language: eng
Format: epub, mobi, pdf
Tags: Computers & Technology, Programming Languages, Programming, Functional Programming, F#, Design
Amazon: B01CGKAINU
Publisher: Packt Publishing
Published: 2016-11-28T23:00:00+00:00


Note that the binding for twoByTwo did not bring any calculations to life, but it wrapped the future calculation into the Lazy type. Then, the first twoByTwo.Force() function performed the wrapped calculation, so the side-effect popped up. Finally, any consequent twoByTwo.Force() function will just repeatedly bring the result of the very first calculation without any side-effects.

The lazy evaluation pattern has its own niche in enterprise F# development. I often use it when in need of a resource that's probably being initialized; if this need really materializes, I want it to happen only once. For example, we can consider reading the Production environment configuration settings from Azure KeyVault when a service runs in the Production environment while using some other configuration information carrier in other environments, for example, environment variables pointing to data stubs.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.