Home
Insert
Update snippet 'Lazy values and indentation'
Title
Description
Different ways to write lazy values - using the lazy keyword or the Lazy.Create function. Pick the one you like the most!
Source code
// Possible incorrect indentation :-( let foo = lazy printfn "hi" 1 + 2 // Uh, oh, this looks a bit ugly... let zoo = lazy printfn "hi" 1 + 2 // Longer, but simpler indentation... let bar = Lazy.Create(fun _ -> printfn "hi" 1 + 2 )
Tags
lazy
lazy
Author
Link
Reference NuGet packages
If your snippet has external dependencies, enter the names of NuGet packages to reference, separated by a comma (
#r
directives are not required).
Update