2008/6/7 Conal Elliott <[EMAIL PROTECTED]>:
> I'm trying to do some fusion in ghc, and I'd greatly appreciate help with
> the code below (which is simplified from fusion on linear maps).  I've tried
> every variation I can think of, and always something prevents the fusion.
>
> [snip]
>
> {-# INLINE onInt #-}
> onInt :: AsInt a => (Int -> Int) -> (a -> a)
> onInt f = fromInt . f . toInt

I don't know if this will help but add this to prevent GHC from
inlining the definition of fromInt (or toInt) in the first phase:

{-# NOINLINE [1] fromInt #-}
{-# INLINE [2] fromInt #-}

It might be possible to combine the both into one pragma but I don't know how.

-- Johan
_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to