#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):

 Yes, that's why I said that types should be marked "with corresponding C
 types" (maybe "tagged" would be a better word). When a programmer
 "matches" newtypes from other Haskell libraries with the types of
 arguments of the C function he wants to import, he does it by '''name'''.
 '''I''' don't need to know how exactly, say, CTime is represented to
 "match" it with time_t, '''compiler''' does. My point is that while
 exporting constructors does expose representation to GHC's FFI checking
 code, it also exposes it to programmers that use the module. And I don't
 think that the former should require/force the latter. I want to have
 control over the export list, compiler can use other means of making
 representation accessible to it's own code.

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