Shared values in GHC

The Question Link to heading When we have many data structures that contain the same large value, does GHC preserve sharing to save memory? For example, if we create 100 Foo values that each contain the same large HashSet , will GHC be smart enough to share that single HashSet in memory, or will it create 100 separate copies? This minimal example demonstrates that GHC does preserve sharing when we…