[GHC] #1965: Allow unconstrained existential contexts in newtypes

GHC trac at galois.com
Mon Dec 10 03:22:35 EST 2007


#1965: Allow unconstrained existential contexts in newtypes
-----------------------------+----------------------------------------------
 Reporter:  guest            |          Owner:         
     Type:  feature request  |         Status:  new    
 Priority:  normal           |      Milestone:         
Component:  Compiler         |        Version:  6.8.1  
 Severity:  minor            |     Resolution:         
 Keywords:                   |     Difficulty:  Unknown
 Testcase:                   |   Architecture:  Unknown
       Os:  Unknown          |  
-----------------------------+----------------------------------------------
Comment (by simonpj):

 Why is this useful?

 In GHC it's disallowed because an existential is modeled as a data
 constructor with a field that captures the type in the same way that it
 captures the value fields.  But since the representation of a newtype is
 supposed to be the same as the representation of the (single) field, you
 can't do that.

 So, it'd be quite difficult to make GHC do this (i.e. it'd affect GHC's
 typed intermediate language); and I can't see any useful applications.

 Simon

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


More information about the Glasgow-haskell-bugs mailing list