#4937: Remove indirections caused by sum types, such as Maybe ---------------------------------+------------------------------------------ Reporter: tibbe | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.0.1 Keywords: | Testcase: Blockedby: | Difficulty: Os: Unknown/Multiple | Blocking: Architecture: Unknown/Multiple | Failure: None/Unknown ---------------------------------+------------------------------------------
Comment(by simonmar): I believe we thought about this when we did pointer tagging. The problem is that while you could shortcut the `Just` constructor by packing its field into the pointer, there are no bits left for the tags on the ''field''. e.g. suppose we have a pointer `P` pointing to a `Just` value (tag bits 11), and the field of the `Just` is `Q`, tag bits 10: {{{ P_11 -> Just (Q_10 -> V) }}} if we represeted this by just {{{ Q_11 -> V }}} then we've lost the tag bits (10) on Q, and we have no knowledge of V. So then we have to fall back to untagged pointers, and that could hurt performance a lot. -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4937#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler _______________________________________________ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs