Created
September 28, 2017 15:32
-
-
Save realvictorprm/4642a90ce9538596720fbc0d9f5dd0e3 to your computer and use it in GitHub Desktop.
Those cases here show when allocations happen without being want.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type WhoDesignedThisAnyway = | |
{ Field: string } | |
/// allocates two functions, and a tuple each time this is called. | |
static member Lens = (fun x -> x.Field), (fun v x -> {x with Field = v }) | |
module WhoDesignedThisAnyway = | |
/// doesn't allocate | |
let Lens2 = (fun x -> x.Field), (fun v x -> {x with Field = v }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment