#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 mikhail.vorozhtsov):

 Once again, I, as a programmer, am completely fine if the module
 documentation says that MyType mirrors time_t, exported constructor
 doesn't help me a bit (one way to ensure that would be by writing
 something like {{{let unused = MyType (undefined :: CTime)}}}, but what
 about {{{newtype MyType = MyType Int64}}} (assuming time_t ~ int64_t), how
 would you check all possibilities?). GHC doesn't ensure that FFI import's
 types are right (with respect to the C types), programmer does. Well,
 exporting guts may be seen as a sort of documentation, but I'd rather not
 encourage/require that practice.

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