| This is the main wibble people forget when writing rules -- inlining.
| In your example, 'gen' is so cheap, it is immediately
| inlined, so it won't be available to match on in your rule.
I'll add a note in the user manual about this.
In general, GHC tries RULES before inlining. In this parti
Hi Simon,
On May 29, 2008, at 11:19 AM, Simon Marlow wrote:
Ok, I've now modified the patch and attached a new version to the
ticket:
http://hackage.haskell.org/trac/ghc/attachment/ticket/2013/2013.patch
*BSD folks please test.
I built the 20080529 snapshot with this patch and my light
Hello Simon,
Friday, May 30, 2008, 5:30:25 PM, you wrote:
may be i don't understand something. isn't it better to do automatic
SAT and inline results for every recursive function marked as INLINE?
it's how i want to work - just mark with INLINE speed-critical funcs.
manual checking that they are
| main = print $ foldl' (+) 0 [1..]
|
| with
|
| foldl' f y xs = foldl' y xs
| where foldl' y [] = y
| foldl' y (x:xs) = foldl' (f y x) xs
|
| runs indefinitely with very little memory consumption, while
|
| foldl' f y [] = y
| foldl' f y (x:xs) = foldl' f (f y x) xs
|
| rapidly c
On Thu, 2008-05-29 at 23:48 -0400, Tyson Whitehead wrote:
> main = print $ foldl' (+) 0 [1..]
>
> with
>
> foldl' f y xs = foldl' y xs
> where foldl' y [] = y
> foldl' y (x:xs) = foldl' (f y x) xs
>
> runs indefinitely with very little memory consumption, while
>
> foldl' f y
I was able to statically link in libgmp.a by changing my installation:
1. I've copied libgmp.a into /lib/ghc-6.8.2
2. I've changed /lib/ghc-6.8.2/package.conf manually:
changed:
], frameworkDirs = [], frameworks = ["GMP"],
to:
,"-lgmp"], frameworkDirs = [], frameworks = [],
so that "-lgmp"