Proposal: EPHEMERAL pragma

Jan-Willem Maessen jmaessen at alum.mit.edu
Thu Oct 25 21:15:47 CEST 2012


On Thu, Oct 25, 2012 at 9:56 AM, José Pedro Magalhães <jpm at cs.uu.nl> wrote:

> Hi all,
>
> Following up on a chat with Simon Peyton Jones at ICFP, I would like to
> discuss the
> possible introduction of a EPHEMERAL pragma. For example:
>
> {-# EPHEMERAL Rep #-}
>> data Rep = ...
>>
>
> This pragma would indicate that the programmer intends the Rep datatype
> not to
> be present in the final generated core code. Its proposed semantics are
> the following:
>
> 1. Make the compiler very keen to inline any functions that produce or
> consume Rep.
>
> 2. If Rep is exported, make all functions that operate on Rep INLINABLE
> (that is, make
> their code available for inlining in other modules).
>
> 3. Emit a warning if the generated core code still contains uses of Rep.
>

Won't all of this require GHC to fix its handling of inlining in the
presence of recursion (am I behind times?  Or does Rep also end up with the
restriction that it should never be an argument to or result from a
recursive function?

-Jan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20121025/a30aa72b/attachment-0001.htm>


More information about the Glasgow-haskell-users mailing list