Skip to content

Instantly share code, notes, and snippets.

@siddhartha-gadgil
Created March 22, 2014 09:37
Show Gist options
  • Save siddhartha-gadgil/9703820 to your computer and use it in GitHub Desktop.
Save siddhartha-gadgil/9703820 to your computer and use it in GitHub Desktop.
open import Nat
upto : ℕ → List ℕ
upto zero = []
upto (succ n) = (upto n) ++ ((succ n) :: [])
listsqs : ℕ → List ℕ
listsqs n = upto n map (λ x → (x * x))
sumsqs : ℕ → ℕ
sumsqs n = fold (listsqs n) by _+_ from zero
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment