#5529: Newtypes with hidden constructors cannot be passed as FFI arguments
-----------------------------------+----------------------------------------
    Reporter:  mikhail.vorozhtsov  |        Owner:              
        Type:  bug                 |       Status:  new         
    Priority:  normal              |    Milestone:              
   Component:  Compiler            |      Version:  7.3         
    Keywords:                      |     Testcase:              
   Blockedby:                      |   Difficulty:              
          Os:  Unknown/Multiple    |     Blocking:              
Architecture:  Unknown/Multiple    |      Failure:  None/Unknown
-----------------------------------+----------------------------------------

Comment(by simonmar):

 I think GHC is correct now.  This was discussed a long time ago on the FFI
 list (no link handy, sorry), and I think the principle is that in order to
 use a newtype in an FFI declaration you have to know its representation,
 because you're linking against some known C code that depends on the
 representation.  So if we allowed that to happen with an abstract newtype,
 it would constitute leakage of the abstraction.

 We ought to change `Foreign.C.Types` to export the types non-abstractly.

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

Reply via email to