Skip to content

Commit

Permalink
bug: restored deleted Nat operations
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmckinna committed Jan 22, 2025
1 parent c75b172 commit 7eb7626
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Data/List/Base.agda
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ null : List A → Bool
null [] = true
null (x ∷ xs) = false

sum : List ℕ
sum = foldr _+_ 0

product : List ℕ
product = foldr _*_ 1

length : List A
length = foldr (const suc) 0

Expand Down

0 comments on commit 7eb7626

Please sign in to comment.