#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):
To sum things up.
1. Exported constructors do not help programmers to get the FFI import's
types right, as GHC provides no way to (automatically) assert that type X
is a wrapper (using arbitrary number of layers) around "primitive" type
which is equivalent to the desired C type y_t.
2. GHC's FFI implementation does need to know the representations of the
types used in an FFI import. But this information does not necessarily
need to be passed around in the form of exported constructors. Store it
somewhere else in the module interface and leave the export list to
programmers.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5529#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