Re: Rewrite rules in Core

2008-03-07 Thread Guilherme Avelino
When I compile the follow code main :: IO() main = print ((iterate anyFunc 3)!!8) is generated, in the core representation, a call to iterateFB1 instead of iterate. Does this happen due to rule described below? {-# RULES "iterate"[~1] forall f x.iterate f x = build (\c _n -> iterateFB c

Re: Rewrite rules in Core

2008-03-07 Thread Tim Chevalier
On 3/7/08, Guilherme Avelino <[EMAIL PROTECTED]> wrote: > Hi, > > I´m using the flag -fext-core to obtain the core of a program. But, rewrite > rules not changed this code. Are there any way to observe the changes cause > by rewrite rules on Core language? > > For sample: > > iterate :: (a -> a) -

Re: Rewrite rules in Core

2008-03-07 Thread Don Stewart
gavelino: >Hi, > >I'm using the flag -fext-core to obtain the core of a program. But, >rewrite rules not changed this code. Are there any way to observe the >changes cause by rewrite rules on Core language? > Yeah, -ddump-simpl-iterations -ddump-simpl-stats will show each iterat

Rewrite rules in Core

2008-03-07 Thread Guilherme Avelino
Hi, I´m using the flag -fext-core to obtain the core of a program. But, rewrite rules not changed this code. Are there any way to observe the changes cause by rewrite rules on Core language? For sample: iterate :: (a -> a) -> a -> [a] iterate f x = x : iterate f (f x) iterateFB c f x = x `c` i