#4937: Remove indirections caused by sum types, such as Maybe
------------------------------+---------------------------------------------
  Reporter:  tibbe            |          Owner:                  
      Type:  feature request  |         Status:  new             
  Priority:  normal           |      Milestone:  7.4.1           
 Component:  Compiler         |        Version:  7.0.1           
Resolution:                   |       Keywords:                  
  Testcase:                   |      Blockedby:                  
Difficulty:                   |             Os:  Unknown/Multiple
  Blocking:                   |   Architecture:  Unknown/Multiple
   Failure:  None/Unknown     |  
------------------------------+---------------------------------------------

Comment(by tibbe):

 Couldn't we represent a sum of pointers (e.g. `data Either a b = Left a |
 Right b`) as a new heap object, a sum-pointer object, which uses tag bits
 to distinguish the constructors? This, together with the optimization to
 distinguish nullary constructors, would allow this data type to be
 represented with a single pointer:

 {{{
 data Elem k v = Null | Key k | Value v | Subtree (Tree k v)
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4937#comment:11>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to