On 24 March 2010 16:01, 国平张 <zhangguop...@gmail.com> wrote: > Hi, > > I wrote a type program to compute fibonacci series, if the max value > is big, then it becomes very slow. > like > > take 100 fib > > How can I make it faster :-)
Use a better algorithm: http://tinyurl.com/ya3vvye Try doing your code by hand for say "fibo 5" to see why it's so bad (hint: GHC does not do CSE in general). -- Ivan Lazar Miljenovic ivan.miljeno...@gmail.com IvanMiljenovic.wordpress.com _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe