#1965: Allow unconstrained existential contexts in newtypes
-------------------------------+--------------------------------------------
  Reporter:  guest             |          Owner:                  
      Type:  feature request   |         Status:  new             
  Priority:  normal            |      Milestone:  7.6.1           
 Component:  Compiler          |        Version:  6.8.1           
Resolution:                    |       Keywords:                  
        Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
   Failure:  None/Unknown      |     Difficulty:  Unknown         
  Testcase:                    |      Blockedby:                  
  Blocking:                    |        Related:                  
-------------------------------+--------------------------------------------

Comment(by simonpj):

 Anything involving existentials is going to be hard to implement using
 newtype directly.  But as 'mokus' says, it might be possible to make a
 guarantee, right in the code generator, that certain sorts of data types
 do not allocate a box.  The conditions are, I think, very nearly as
 'mokus' says:
  1. Only one constructor
  2. Only one field with nonzero width in that constructor (counting
 constraints as fields)
  3. That field is marked strict
  4. That field has a boxed (or polymorphic) type
 I think this'd be do-able.  The question is how important it is in
 practice; it's one more thing to maintain.

 Simon

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1965#comment:9>
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