Re: [Haskell-cafe] library on common sub-expression elimination?

2011-08-15 Thread Emil Axelsson
2011-08-13 05:40, Levent Erkok skrev: On 8/12/2011 10:30 AM, Conal Elliott wrote: Note that data-reify will only find *some* common/equal sub-expressions, namely the pointer-equal ones. In all of my code-generating (deep) DSLs, it's been very important for efficiency to also pull out

Re: [Haskell-cafe] library on common sub-expression elimination?

2011-08-12 Thread oleg
I guess you mean the function that converts an abstract syntax tree to a directed acyclic graph (DAG). Just for completeness I should mention that if the object language has effects including non-termination, one has to be careful eliminating seemingly common expressions. For example, in

Re: [Haskell-cafe] library on common sub-expression elimination?

2011-08-12 Thread Anton Kholomiov
Just to make it explicit, is it \a i - let t = a ! i in if i = 0 then t else if i 0 then t + a ! (i-1) else bad idea, because of last else-case? Can it be mended with one another pass for if-expressions? The upcoming

Re: [Haskell-cafe] library on common sub-expression elimination?

2011-08-12 Thread Conal Elliott
:00, Anton Kholomiov anton.kholom...@gmail.com wrote: Is there a library on common sub-expression elimination? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] library on common sub-expression elimination?

2011-08-12 Thread Anton Kholomiov
libraries. You might be able to find examples that you can adapt to your own AST written with Uniplate or similar library. On 11 August 2011 05:00, Anton Kholomiov anton.kholom...@gmail.com wrote: Is there a library on common sub-expression elimination

Re: [Haskell-cafe] library on common sub-expression elimination?

2011-08-12 Thread Conal Elliott
: Is there a library on common sub-expression elimination? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing

Re: [Haskell-cafe] library on common sub-expression elimination?

2011-08-12 Thread wren ng thornton
On 8/12/11 12:52 PM, Anton Kholomiov wrote: Just to make it explicit, is it \a i - let t = a ! i in if i= 0 then t else if i 0 then t + a ! (i-1) else bad idea, because of last else-case? Can it be mended with one

Re: [Haskell-cafe] library on common sub-expression elimination?

2011-08-12 Thread Levent Erkok
On 8/12/2011 10:30 AM, Conal Elliott wrote: Note that data-reify will only find *some* common/equal sub-expressions, namely the pointer-equal ones. In all of my code-generating (deep) DSLs, it's been very important for efficiency to also pull out equal-but-pointer-unequal expressions. -

Re: [Haskell-cafe] library on common sub-expression elimination?

2011-08-12 Thread Vinod Grover
in let t= a!i a!i might be out of bounds ? On Fri, Aug 12, 2011 at 9:52 AM, Anton Kholomiov anton.kholom...@gmail.comwrote: Just to make it explicit, is it \a i - let t = a ! i in if i = 0 then t else if i 0 then t + a ! (i-1)

Re: [Haskell-cafe] library on common sub-expression elimination?

2011-08-11 Thread Stephen Tetley
. On 11 August 2011 05:00, Anton Kholomiov anton.kholom...@gmail.com wrote: Is there a library on common sub-expression elimination? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] library on common sub-expression elimination?

2011-08-11 Thread Anton Kholomiov
or similar library. On 11 August 2011 05:00, Anton Kholomiov anton.kholom...@gmail.com wrote: Is there a library on common sub-expression elimination? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo

Re: [Haskell-cafe] library on common sub-expression elimination?

2011-08-11 Thread Stephen Tetley
can adapt to your own AST written with Uniplate or similar library. On 11 August 2011 05:00, Anton Kholomiov anton.kholom...@gmail.com wrote: Is there a library on common sub-expression elimination? ___ Haskell-Cafe mailing list Haskell-Cafe

Re: [Haskell-cafe] library on common sub-expression elimination?

2011-08-11 Thread Vo Minh Thu
: Is there a library on common sub-expression elimination? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe

[Haskell-cafe] library on common sub-expression elimination?

2011-08-10 Thread Anton Kholomiov
Is there a library on common sub-expression elimination? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe