Phyx <loneti...@gmail.com> writes:

>> I highly doubt that this split will have any measurable overhead.
>> Reexporting a definition defined in one module from another module via
>> an export list does not produce any code at all; importing such a
>> declaration is equivalent to importing the definition from the defining
>> module.
>
> Ah right, I can see how that's true at the Haskell level but..
>
>> If for some reason we can't in some cases directly reexport then we
>> would likely rather have a some very trivial bindings that GHC would be
>> quite eager to inline.
>
> Sure, I can see how you'd inline based on the haskell contract, I can't see
> how you avoid the compile time overhead when compiling the library. If you
> have a haskell library
>
> module Test (Control.Monad.when, Control.Applicative.many) where
>
> import Control.Monad(when)
> import Control.Applicative(many)
>
> compiling it:
>
>  ghc test.hs
> [1 of 1] Compiling Test             ( test.hs, test.o )
>
To clarify, what is happening in this program is not inlining. Rather
when you re-export `Control.Monad.when` from `Test` GHC merely records
this fact in the interface file it produces for `Test`. No code is
generated for `when` in `Test`.

Cheers,

- Ben

Attachment: signature.asc
Description: PGP signature

_______________________________________________
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Reply via email to