[Haskell-cafe] zlib build failure on recent GHC

Daniel Fischer daniel.is.fischer at googlemail.com
Mon Nov 7 22:00:28 CET 2011

On Monday 07 November 2011, 21:06:17, Jason Dagit wrote:
> On Mon, Nov 7, 2011 at 8:17 AM, Johan Tibell <johan.tibell at gmail.com> 
> > This is due to a change in how FFI imports and newtypes work. GHC was
> > recently changed to not allow you to use newtypes in FFI imports
> > unless the constructor of the newtype is in scope. This broke quite a
> > few libraries. I have patched a few of them and I've sent a patch to
> > the zlib maintainer.
> This seems like a big change.

But it introduces conformance with the report:

(sec. 8.4.2, Foreign Types)

"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."

Previous behaviour violated that, hence the change.

> Where should I be watching to know
> about this ahead of time?  I bet I have to fix some of my packages.
> Thanks,
> Jason

More information about the Haskell-Cafe mailing list