Specialising NOINLINE functions
oleg.grenrus at iki.fi
Fri May 6 09:07:59 UTC 2022
There is a (stale) ghc-proposal for that,
On 6.5.2022 12.04, Simon Peyton Jones wrote:
> Dear devs
> At the moment the INLINEABLE pragma means "capture my right-hand side,
> regardless of how big it is, so that it can be type-class-specialised,
> including in other modules". But it /also /says "feel free to inline me".
> Some users (eg Gergo) want to say NOINLINE on some functions. But for
> these they'd still like to generate type-class-specialised versions.
> After all, if we aren't going to inline them, specialising is the next
> best thing.
> But we have no way to say both "specialise me" and "don't inline me",
> because you can't say both INLINEABLE and NOINLINE. (That would look
> I think we should probably just bite the bullet and add a
> SPECIALISABLE pragma, /orthogonal to INLINE/NOINLNE/, which say
> "capture my right-hand side, regardless of how big it is, so that it
> can be type-class-specialised, including in other modules". It
> behaves exactly like INLINEABLE except that you can specify it along
> with INLINE/NOINLINE.
> Any thoughts? Do you think this needs a GHC proposal?
> See #21036 <https://gitlab.haskell.org/ghc/ghc/-/issues/21036#note_407930>
> ghc-devs mailing list
> ghc-devs at haskell.org
More information about the ghc-devs