Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Norman Ramsey <nr <at> eecs.harvard.edu>
Subject: inlining higher-order-functions?
Newsgroups: gmane.comp.lang.haskell.glasgow.user
Date: Friday 22nd December 2006 05:23:57 UTC (over 10 years ago)
I've just discovered the {-# INLINE #-} pragma, but it's not
doing as much for me as I had hoped.

My example is complicated, so let me present a simpler analogy.
Suppose I defined

compose :: (b -> c) -> (a -> b) -> (a -> c)
compose f g = \x -> f (g x)

I can easily persuade GHC to inline 'compose'.
But when 'compose' is applied to known arguments, I wish
f and g to be inlined in the body of 'compose'.
Is there a pragma that will do the trick?
(I attempted to put an INLINE pragma in a where clause,
but GHC was not amused.)


Norman
 
CD: 2ms