[Haskell] Expecting more inlining for bit shifting

John Meacham john at repetae.net
Wed Oct 18 01:36:47 EDT 2006

On Mon, Oct 09, 2006 at 03:54:41PM +0100, Ian Lynagh wrote:
> It might be possible, but it sounds tricky. I guess it would have to go
> something like "try inlining this, run the simplifier, see if it got
> small enough, if not back out", which could waste a lot of work if it
> fails in lots of cases.

I would think the easiest way to go about this would be to extend the
rules pragma.

{-# RULES "shift/const-inline"  forall x y# . shift x y# = ... #-}

where variables ending in # will only match constants known at compile
time. or perhaps..

{-# RULES "shift/const-inline"  forall x (y::const Int) . shift x y# = ... #-}

or something like that.

I imagine such a thing would have other uses as well...


John Meacham - ⑆repetae.net⑆john⑈

More information about the Glasgow-haskell-users mailing list