Re: bad pattern-matching

1992-11-10 Thread kh
> Consider the following Haskell-definition: > > nfib 0 = 1 > nfib 1 = 1 > nfib (n + 2) = nfib n + nfib (n + 1) + 1 > > > main = print (nfib 30) > > > Execution of the (via hbc) compiled file > results in 2692537 in 255 seconds. > > > Changing the above definition like t

Re: bad pattern-matching

1992-11-10 Thread Ian Poole
> .. > > But I do not want to program without using the > well-known advantages of such patterns: > > - increased readability > - distinct left-hand-sides Personally I find the second form (ie without n+k patterns) the easier to read, and I've

bad pattern-matching

1992-11-10 Thread Marc Rehmsmeier
Consider the following Haskell-definition: nfib 0 = 1 nfib 1 = 1 nfib (n + 2) = nfib n + nfib (n + 1) + 1 main = print (nfib 30) Execution of the (via hbc) compiled file results in 2692537 in 255 seconds. Changing the above definition like this: nfib 0 = 1 nfib 1 =