#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 igloo):
The [http://www.haskell.org/onlinereport/haskell2010/haskellch8.html
Haskell 2010 report] says:
{{{
the constructor N is visible where T is used
[...]
Consequently, in order for a type defined by newtype to be used in a
foreign declaration outside of the module that defines it, the type
must not be exported abstractly.
}}}
This was fixed in response to #3008.
Incidentally, the report also says:
{{{
The module Foreign.C.Types that defines the Haskell equivalents
for C types follows this convention
}}}
but I don't understand what that means, as those types are exported
abstractly. Perhaps they shouldn't be?
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5529#comment:2>
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