Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide interesting example programs #61

Closed
5 tasks done
quchen opened this issue May 27, 2016 · 0 comments
Closed
5 tasks done

Provide interesting example programs #61

quchen opened this issue May 27, 2016 · 0 comments

Comments

@quchen
Copy link
Owner

quchen commented May 27, 2016

  • Associativity of list concatenation: left is quadratic, right is linear

  • Naive repeat/cycle vs version with good sharing

  • Naive Fibonacci: fib n = fib (n-1) + fib (n-2)

  • Improved, linear Fibonacci

    fib = fib' 0 1
      where
        fib' x _ | n <= 0 = x
        fib' x !y n = fib' y (x+y) (n-1)
  • foldl vs foldl-via-foldr

@quchen quchen self-assigned this May 27, 2016
quchen added a commit that referenced this issue May 27, 2016
This is part of #61, and currently contains two Fibonacci
implementations.
@quchen quchen removed their assignment May 27, 2016
quchen added a commit that referenced this issue May 28, 2016
@quchen quchen closed this as completed in 9069983 May 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant