
7 Jun
2008
7 Jun
'08
6:37 a.m.
2008/6/7 Conal Elliott
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