On 24 March 2010 16:01, 国平张 <[email protected]> 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 [email protected] IvanMiljenovic.wordpress.com _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
