> 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
> ..
>
> 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
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 =