
#9765: Strange behavior of GC under ghci -------------------------------------+------------------------------------- Reporter: remdezx | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.8.3 Resolution: | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: Incorrect | Blocked By: result at runtime | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by rwbarton):
Why is there a difference between doing it with `do` notation and with `let` binding?
Well, this part is easy: the `let` binding is generalized over the type of the numeric literal `1`, so that `a` is really a function that constructs a new Map and a new ForeignPtr each time it is called (evaluated). The result in the `do` notation is not generalized, and is really a Map. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9765#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler